Cannot find function selectNewLine in object stand...
# ask-stanley-ai
n
Cannot find function selectNewLine in object standard subrecord
c
AI generated answer (using internal Slack threads):
The error "Cannot find function selectNewLine in object standard subrecord" is occurring because the
selectNewLine
function is not available in standard mode. This function is only available in dynamic mode. If you are loading a record with
record.load({type: 'type', id: 'id', isDynamic: false})
, the
selectNewLine
function will not be available. If
isDynamic
is set to
true
, then you can use it. In standard mode, you should use
setSublistValue
instead of
selectNewLine
. Here is an example of how to use `setSublistValue`:
Copy code
javascript
salesOrder.setSublistValue({
    sublistId: 'item',
    fieldId: 'item',
    line: 1,
    value: itemId
});

salesOrder.setSublistValue({
    sublistId: 'item',
    fieldId: 'quantity',
    line: 1,
    value: quantity
});
Also, remember that line indexes start at 0, not 1. So, if you are trying to set the value for the first line, you should use
line: 0
. ****** 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.849482656
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824896932
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82245177
Please provide your feedback on this answer.