Could anyone advise on how to do this? I have a “Quote” record which is composed of its linked “Line Item” records.
In order to create a new version of a Quote I’m trying to create copy of the Quote, copies of all the Quote’s Line Items and set the new Line Items as the value for the new Quote’s Line Item field.
The problem is that I can never get the Line Item field to accept my new Line Items ids. I’m sure this has to do with the order of async and await operations but I can’t figure it out. My latest attempt follows;
This seems inefficient. You could batch create the records using lineItemsTable.createRecordsAsync(). Just like its singular function, the batch function returns the IDs of the new records, so you don’t need to push each ID to an array; it already returns an array.