Shelby Owens
12/10/2024, 4:03 PMCeligo AI
12/10/2024, 4:04 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** The error you're encountering is due to the fact that the
commitLine
function is not used on regular (non-dynamic) records. Also, the newRecord
during beforeSubmit
is not in dynamic mode.
In a beforeSubmit
User Event script, you only need to use setSublistValue
on the next available line. You don't need to insert the line unless you actually want to insert a line at the first line.
Here's an example of how you can add a new line to a sublist in a beforeSubmit
User Event script:
javascript
newRecord.setSublistValue({
sublistId: 'salesteam',
fieldId: 'employee',
line: thenextline,
value: 1
});
In this example, thenextline
is the line count since it's zero indexed.
Please note that for an afterSubmit
User Event script, you need to load the record again and save it to make your changes. However, keep in mind that this is generally not a good practice as it will double your sales order save times.Celigo AI
12/10/2024, 4:04 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.864911556
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.862662911
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.860925674
Celigo AI
12/10/2024, 4:04 PM