Cannot find function getCurrentSublistValue in obj...
# ask-stanley-ai
n
Cannot find function getCurrentSublistValue in object standard record in userevent suitescript
c
AI generated answer (using internal Slack threads):
The function
getCurrentSublistValue
is not available in the standard mode of SuiteScript. It is only available in dynamic mode. If you are using standard mode, you will need to use the
getSublistValue
function instead. In dynamic mode, you can use the
getCurrentSublistValue
function to get the current value of a sublist field. However, to set a sublist value in dynamic mode, you need to use the
selectLine
,
setCurrentSublistValue
, and
commitLine
functions in sequence. Here is an example of how to use these functions in dynamic mode:
Copy code
{
    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'
    });
}
Remember to replace 'sublist_2' and 'fee_item' with your actual sublist ID and field ID. ****** 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.84340483
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840338588
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84030968
Please provide your feedback on this answer.