Your script would need to do this to create a new vendor record:
Go to Layout ["vendors" (Vendors) ]
Go to Layout [originalLayout]
Go to Object ["objectName of New Vendor slide Panel goes here"]
You'll need to add the slide control panel's object name so that the popover is re-opened once the script returns to the original layout.
And you'll need to use one of two methods with this: Collect data about the new vendor in global fields, then add set field steps after new Records request in the above script to set the fields of the new record to the value of these globals or Set the ID of the new Vendor record to a variable so that a field in your Transactions layout can be set to this value so that the "new vendor" panel fields can use a third relationship based on this ID to access the correct record.
Thanks for the reply. I decided to use global fields with the script. (as seen below). Checking with the debugger, it goes smoothly, however, although it creates a new record, it actually replaces all the fields of an existing record (ie. it creates record 50, but cleans up the fields of the record which is live on the main layout.
I am little confused. What am i doing wrong?
Thanks once again
You need to stay on the portal table's layout until all the set field steps are executed, then use go to layout and go to object to return to the popover.
Thanks once again Phil for your valuable help! It works...however I mande some changes, I was not able to achieve my intented using one popover and 2 slides...I am still using the global fields though and it works (some more housekeeping to clean up global fields). But it is all goot at this point.
What I have done now is. On the main layout (transactions), I have a the _kp_vendors_ID, with a dropdown list pulling the vendors names to pull the info about the company and fill the blanks (Company Name, Tax Numbers, Contat and Phone). If the company is not on the list, then a popover button is available to allow the user to enter info of the new company.
But, now it would be nice, once the new info is entered, onScritexit, this new information be set on those fields on the main layout, whithout the user having to go to the dropdown list and look for that company...
Any ideas, how my script would look like in this case? I have tried with an examplo from the Start Solution (invoices), but it is not working the way i intend.
Thanks once again.
The script should be able to use Set field to set that drop down list field to the needed value. Just use Set variable to copy this value from the new record to a variable first after the new record was created so that a step near the end of the field can use this variable with set field to update the other field and thus link the current layout record to this new related record.