Skip to main content

Bulk Insert of Linked Records

  • March 27, 2020
  • 4 replies
  • 28 views

Forum|alt.badge.img+3

I have 2 tables (Part Processes Table and Jobs Processes Table). The Part Processes Table contains all the operations for making a part. Every time a new purchase order comes in a job is created and linked to a particular part. I would like to create a script that grabs the linked records in the Part Processes Table and inserts them into the Jobs Processes Table every time a new job is created. Can anyone provide me with an example of something similar that I can modify for my purposes?

4 replies

Stephen_Suen
Forum|alt.badge.img+19
  • Employee
  • 83 replies
  • March 27, 2020

Hey @Jeremy_Taylor:

You should be able to repurpose the Record template example for your use case. The main modification you would need to make is to fetch the template records from your Part Processes Table instead of hardcoding them in the script.

Let me know if this makes sense!


Forum|alt.badge.img+3
  • Author
  • Known Participant
  • 11 replies
  • March 27, 2020

Hey @Jeremy_Taylor:

You should be able to repurpose the Record template example for your use case. The main modification you would need to make is to fetch the template records from your Part Processes Table instead of hardcoding them in the script.

Let me know if this makes sense!


Hey @Stephen_Suen

Yes, That makes sense. What syntax do I use to fetch those records?


Forum|alt.badge.img+4

Hey @Stephen_Suen

Yes, That makes sense. What syntax do I use to fetch those records?


Hi @Jeremy_Taylor

You can fetch records with table.selectRecordsAsync(). This returns a RecordQueryResult with the a list of all the records (queryResult.records), as well as a function for fetching a single record by ID (queryResult.getRecord()).


  • New Participant
  • 1 reply
  • May 4, 2022

Hey @Jeremy_Taylor:

You should be able to repurpose the Record template example for your use case. The main modification you would need to make is to fetch the template records from your Part Processes Table instead of hardcoding them in the script.

Let me know if this makes sense!


hello how can i use this?