Ron
11/11/2024, 8:17 PMCeligo AI
11/11/2024, 8:18 PMAI generated answer (using internal Slack threads):Yes, you can add a sublist item while not in dynamic mode in SuiteScript. You can use the
setSublistValue
method to set sublist line values without using selectLine
first. However, this only works if the record is not in dynamic mode.
Here is an example of how you can use `setSublistValue`:
javascript
var sublistId = 'sublist_2';
var fieldId = 'fee_item';
var line = 0;
var value = 100;
var myRecord = currentRecord.get();
myRecord.setSublistValue({
sublistId: sublistId,
fieldId: fieldId,
line: line,
value: value
});
Please note that the sublist type should not be of type LIST as it does not allow adding lines. Also, ensure that the sublist and field IDs are correct.
******
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
11/11/2024, 8:18 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844347537
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843230903
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841768265
Celigo AI
11/11/2024, 8:18 PM