Mark
04/14/2025, 3:25 PMCeligo AI
04/14/2025, 3:25 PMAI generated answer (using internal Slack threads):To add a line to the link sublist for a work order in SuiteScript, you would need to use a User Event Script. This script would be triggered when a specific event occurs, such as the creation or editing of a work order. Here is a general idea of how you might approach this: 1. Create a User Event Script that is triggered on the creation or editing of a work order. 2. In the script, use the
recordgetSublistinsertLinesetSublistValuejavascript
var record = require('N/record');
function userEventScript(context) {
    var workOrder = context.newRecord;
    var sublist = workOrder.getSublist({sublistId: 'link'});
    
    sublist.insertLine({line: sublist.lineCount});
    sublist.setSublistValue({fieldId: 'your_field_id', line: sublist.lineCount - 1, value: 'your_value'});
    
    workOrder.save();
}
exports.beforeSubmit = userEventScript;'link''your_field_id''your_value'Celigo AI
04/14/2025, 3:25 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836383045
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831028
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823122501
Celigo AI
04/14/2025, 3:25 PM