Aaron McCausland
01/28/2025, 11:24 PMCeligo AI
01/28/2025, 11:24 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the issue you're facing is related to the limitations of the Before Load event in the context of a workflow. The Before Load event is not able to reference the individual lines of a sublist, which is why you're unable to see the Inventory Location for each line. In addition, setting the State Field to Line : Location : Location Category during a Create event's Before Load seems to result in a null value. This could be due to the fact that the record is not fully loaded during the Before Load event, and therefore some fields may not be available or may not have been set yet. One possible solution could be to use a combination of SuiteScript and workflows. You could use a User Event Script to capture the Create event and set the State Field. Then, use a workflow with a Sublist Action Group on Before User Submit to reference the individual lines and check their Inventory Location. Here's a sample code for the User Event Script:
javascript
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(['N/record'], function(record) {
function beforeLoad(context) {
if (context.type === context.UserEventType.CREATE) {
var itemFulfillment = context.newRecord;
// Set the State Field
itemFulfillment.setValue({
fieldId: 'custbody_state_field', // Replace with your State Field ID
value: 'Line : Location : Location Category' // Replace with your desired value
});
}
}
return {
beforeLoad: beforeLoad
};
});
Please note that this is a general solution and may need to be adjusted to fit your specific business logic and requirements.
******
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/28/2025, 11:25 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855981827
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841583729
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84155
Celigo AI
01/28/2025, 11:25 PM