Issue
User is not able to commit a line item via SuiteScript 2.0 Client Script.
Solution
The reason why the line item is not committing on the script is because the forceSyncSourcing parameter is retains its default value as false.
The forceSyncSourcing parameter indicates whether to perform field sourcing synchronously. If set to true, sources dependent field information for empty fields synchronously.
function pageInit(scriptContext) {
rec = scriptContext.currentRecord;
rec.currentRecord.selectNewLine({
sublistId : "item"
})
rec.currentRecord.setCurrentSublistValue({
sublistId: "item",
fieldId: "item",
value : 25,
forceSyncSourcing: true
});
rec.currentRecord.commitLine({
sublistId: "item"
});
}