darrenhillconsulting
03/12/2025, 7:59 PMCeligo AI
03/12/2025, 8:00 PMAI generated answer (using internal Slack threads):To get the selection dropdown text and value from a Sublist on a Suitelet POST, you can use the
getSublistValue()
method from the ServerRequest object in SuiteScript 2.0. This method allows you to retrieve the value of a sublist field from a POST request.
Here is a basic example of how you can use it:
javascript
var sublistLineCount = context.request.getLineCount({group: 'sublistId'});
for (var i = 0; i < sublistLineCount; i++) {
var sublistValue = context.request.getSublistValue({
group: 'sublistId',
name: 'dropdownFieldId',
line: i
});
// Do something with sublistValue
}
In this example, replace 'sublistId'
with the ID of your sublist and 'dropdownFieldId'
with the ID of your dropdown field. The getLineCount()
method is used to get the number of lines in the sublist, and then a for loop is used to iterate over each line and get the value of the dropdown field.
Remember, the getSublistValue()
method returns the internal ID of the selected option in the dropdown field. If you want to get the text of the selected option, you will need to load the corresponding record and get the text using the getText()
method.
******
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
03/12/2025, 8:01 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85245347
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851842105
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849714458
Celigo AI
03/12/2025, 8:01 PM