Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7325 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Please could someone tell me how to create a script which will automatically create a related record in a separate file?

I have two files, Parts and Purchase Order.

I would like to create a script which will allow me to create a Purchase Order record after a Parts record is created.

At the moment I am having to fill in the details in Parts and then have to go to Purchase Order, insert Customer ID, select "Machine" from a value list, the information (order no., part no. etc.)appears in a portal. Is there a way to do this part automatically?

Many thanks.

Posted

You need 2 scripts, 1 in each file. You will also need global fields to hold info to be passed from one file to the other via a constant relarionship. The script in the related file creates the new record and set fields to values from the global fields in the other file. The script in the first file set the values of the global fields and then calls the script in the related file.

Posted

If you have 'Allow creation of related records' selected in your relationship, then you can Set Field [relationship::nonkeyfield, data] and the relationship will be auto-established via new record creation and nonkeyfield will be populated. You can then Exit Record/Request and proceed to set the remaining fields via relationship. Only one script is necessary for this technique and you don't have to do anything to the related file. See here for more info.

This topic is 7325 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.