In my BeforeLoad Create event-triggered Workflow, ...
# ask-stanley-ai
a
In my BeforeLoad Create event-triggered Workflow, I need to check the lines of an Item Fulfillment after it loads, so see which Locations are set on each line. But when I assign a value to a workflow state field (freeform or checkbox) from any of the item lines in a Set Field Value workflow action, on either Entry or BeforeLoad, then displaying the workflow field's value later in a Before User Submit action of Show Message shows only null in the alert box, which makes it look like there was nothing in the list at the time the sublist action group executed. But there are items in the list by the time Before User Submit runs, it just doesn't let me use sublist action groups in Before User Submit. So how do I retrieve those values from the sublist when the user opens an Item Fulfillment creation page?
c
AI 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:
Copy code
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. ******
Slack 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
Please provide your feedback on this answer.
Thank you for your feedback