Aaron McCausland
01/29/2025, 4:43 PMCeligo AI
01/29/2025, 4:43 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that you are trying to set a sublist value in a BeforeLoad event of a User Event Script, but the value is not being set. According to the NetSuite documentation, changes to a new record in a BeforeLoad event of a User Event Script will be ignored. However, you can use workflows to set field values before a record loads. You can create a sublist action group in your workflow and use a Set Field Value action to set the value of your field. Here is a sample code snippet for setting a sublist value in a workflow:
javascript
record.setSublistValue({
sublistId: 'item',
fieldId: 'custcol_wrx_ci_htn',
line: i,
value: itemRec.getValue({fieldId: 'custitem14'})
});
You can also use a custom field or a workflow field as a condition in your workflow transitions. For example, you can create a checkbox field that gets checked if certain line conditions are true. Then, you can use this field as a condition in your workflow transitions.
Remember to set the field to $0 in a previous action before your workflow runs, otherwise it will continue to add the total each time you save the record.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
01/29/2025, 4:44 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84564
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838112473
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835472
Celigo AI
01/29/2025, 4:44 PMCeligo AI
01/29/2025, 4:47 PM