SunShine
02/14/2025, 7:47 AMCeligo AI
02/14/2025, 7:47 AMAI generated answer (using internal Slack threads):To set a specific field of a sublist value of a Suitelet in ClientScript, you can use the
setCurrentSublistValue
method. This method sets the value of a sublist field on the current sublist line (the line that you have selected using the selectLine
method).
Here is a sample code snippet:
javascript
//ClientScript
function calledViaSublistButtonClick() {
var myRecord = currentRecord.get();
myRecord.selectLine({
sublistId: 'sublist_2',
line: 0
});
myRecord.setCurrentSublistValue({
sublistId: 'sublist_2',
fieldId: 'fee_item',
value: 100,
ignoreFieldChange: true
});
myRecord.commitLine({
sublistId: 'sublist_2'
});
}
In this example, the selectLine
method is used to select the line of the sublist that you want to modify. The setCurrentSublistValue
method is then used to set the value of the 'fee_item' field on the selected line of the 'sublist_2' sublist. The commitLine
method is used to save the changes to the sublist line.
Please ensure that the sublistId and fieldId are correct. The sublistId and fieldId should match the IDs that you have defined in your Suitelet. Also, make sure that the sublist is editable.
******
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
02/14/2025, 7:48 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846741498
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846275508
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831525385
Celigo AI
02/14/2025, 7:48 AM