I am attempting to simplify creating Item Receipts...
# suitescript
w
I am attempting to simplify creating Item Receipts. When submitting, I want to set the line quantity into the item's default bin, so that the user does not get the inventory detail warning. However when attempting to edit the current record
scriptContext.currentRecord.selectLine({ sublistId: 'item', line: i });
let detail = scriptContext.currentRecord.getCurrentSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail',
});
detail.selectNewLine({ sublistId: 'inventoryassignment' });
returns the error
JS_EXCEPTION
NOT_SUPPORTED_ON_CURRENT_SUBRECORD Not supported on current subrecord: CurrentSubrecord.selectNewLine.
a
You are having problems with dynamic vs standard records API methods, in this case you may need to use insertLine() instead of selectNewLine().