Jump to content
Sign in to follow this  
lesley1160

Is it possible?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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