NOT_SUPPORTED_ON_CURRENT_SUBRECORD Not supported o...
# ask-stanley-ai
n
NOT_SUPPORTED_ON_CURRENT_SUBRECORD Not supported on current subrecord: CurrentSubrecord.setCurrentSublistValue.; ID: var lineCount = invSubRec.getLineCount({ sublistId: 'inventoryassignment' }); log.debug({ title: "lineCount ", details: lineCount }); invSubRec.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'issueinventorynumber', value: lot, line: lineCount }); invSubRec.setCurrentSublistText({ sublistId: 'inventoryassignment', fieldId: 'expirationdate', text: exp, line: lineCount });
c
AI generated answer (using internal Slack threads):
The error message
NOT_SUPPORTED_ON_CURRENT_SUBRECORD Not supported on current subrecord: CurrentSubrecord.setCurrentSublistValue.
indicates that the method
setCurrentSublistValue
is not supported on the current subrecord you are working with. In your case, you are trying to set the value of the 'issueinventorynumber' and 'expirationdate' fields on the 'inventoryassignment' sublist of the 'invSubRec' subrecord. From the conversations, it seems that the 'inventoryassignment' sublist does not support the
setCurrentSublistValue
method. Instead, you might need to use the
setSublistValue
method, as shown in the first conversation:
Copy code
javascript
subRecord.setSublistValue({
    sublistId: 'inventoryassignment',
    fieldId: 'issueinventorynumber',
    value: lot,
    line: subRecordCount
});
Also, it's important to note that when working with subrecords, you usually need more than one line of code to create and manipulate them. As shown in the third conversation, you might need to use methods like
selectNewLineItem
,
setCurrentLineItemValue
,
commitLineItem
, and
commit
to properly create and manipulate subrecords. ****** 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.910159171
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.889907897
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.885298848
Please provide your feedback on this answer.