Jeniffer
05/21/2025, 9:57 PMCeligo AI
05/21/2025, 9:58 PMAI generated answer (using internal Slack threads):To get Suitelet sublist values on Suitelet POST request, you can use the
getLineCount
and getSublistValue
methods of the ServerRequest
object in SuiteScript 2.0.
Here is a general approach:
1. Use the getLineCount
method to get the number of lines in the sublist. This method takes the sublist id as a parameter.
javascript
var lineCount = context.request.getLineCount({group: 'sublistId'});
2. Loop through the lines of the sublist using a for loop.
javascript
for (var i = 0; i < lineCount; i++) {
// code to process each line
}
3. Inside the loop, use the getSublistValue
method to get the value of a field in the sublist. This method takes an options object as a parameter, which should contain the sublist id, the field id, and the line number.
javascript
var fieldValue = context.request.getSublistValue({
group: 'sublistId',
name: 'fieldId',
line: i
});
4. You can then process the field value as needed.
Remember to replace 'sublistId' and 'fieldId' with the actual ids of your sublist and field.
******
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
05/21/2025, 9:58 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.880487502
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.863916099
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85853368
Celigo AI
05/21/2025, 9:58 PMCeligo AI
05/21/2025, 10:57 PM