It's not clear to me what isn't clear to you. The script is pretty straightforward with comments.
The idea is you're on a layout showing a related contact, say your visits layout. You're able to view and edit a partiicular contact's information from that layout. You want to add a visit, which includes knowing the primary key of someone from the Contacts table. But what if it's a new patient? This script creates a new contact for you and sets the visit key correctly.
In your case, you looks like you're viewing Visits from the Contacts layout. So the equivalent script would go to the Visits table and make a new record, setting the appropriate key to the Contact you started on.
Thanks for the response.
My issues is this:
- I have a client table based layout, wanted to have all related tables to be represented in that layout itself in Tabs. I am successful doing this with portals. But the Bonsai example is slightly different. In Bonsai the "contact" table (which is connected table of "customer" table, can be used to enter new record (it doesnt look as a portal approach). Same time it also shows the previously entered "contacts" left hand side. Each time I click on that tiny add button, it gives me a new empty fields for Contact details and whatever entered (relevant fields) appears on right hand side's portal.
Now, I want to have, a "Visit" (=Bonsais "Contact" Details) entry to be possible in "Client"(=Bonsais "Customer") layout, on one of the tab and showing all my old "visit" records relevant fields on left hands side on same Tab.
When I replicated this script (not knowing its actual logic), but replacing with relevant fields/names etc, it is not doing the same job which is Bonsai example doing.
Which means, its NOT creating a new record and is stuck to the current entry.
Does this clarify my question further?
Will appreciate your help
We are informal here so first name is o.k.
Please post a copy of your file and I or someone will help you over the rough spot, if you still have this issue.
Post your reply with the web interface where in the upper right is an option for advanced once clicked you can attach a file at the bottom of the post.
i forgot to set the new window step back to off screen.
I set it to 50 / 50 from -5000 / -5000