How can I get the item option values on sales orde...
# ask-stanley-ai
j
How can I get the item option values on sales order lines in a client script?
c
AI generated answer (using internal Slack threads):
To get the item option values on sales order lines in a client script, you can use the
getSublistValue
method. This method allows you to retrieve the value of a sublist field on a record. Here is an example of how you can use it:
Copy code
javascript
var itemOptionValue = rec.getSublistValue({
    sublistId: 'item', 
    fieldId: 'options', 
    line: 0
});
In this example,
rec
is the record instance,
item
is the sublistId,
options
is the fieldId, and
0
is the line number. This will return the value of the 'options' field on the first line of the 'item' sublist. If you want to get the value of a custom field, you can replace 'options' with the scriptId of the custom field. For example:
Copy code
javascript
var customFieldValue = rec.getSublistValue({
    sublistId: 'item', 
    fieldId: 'custcol1', 
    line: 0
});
In this case,
custcol1
is the scriptId of the custom 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. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.883424044
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84096694
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838354468
Please provide your feedback on this answer.