Prashant Kala
01/26/2024, 6:19 PMvar vendorBill = recordModule.create({
type: recordModule.Type.VENDOR_BILL,
isDynamic: true,
defaultValues: {
entity: supplierId
}
});
vendorBill.selectNewLine('item');
vendorBill.setCurrentSublistValue('item', 'orderdoc', poId);
vendorBill.setCurrentSublistValue('item', 'orderline', poLineId);
vendorBill.commitLine('item');
vendorBill.save({
enableSourcing: false,
ignoreMandatoryFields: true
});
This above code is written in a restlet and when we invoke it from postman, we get :
{
"type": "error.SuiteScriptError",
"name": "YOU_CANNOT_ADD_MULTIPLE_VENDORS_ANDOR_CURRENCIES_TO_A_SINGLE_VENDOR_BILL",
"message": "You cannot add multiple vendors and/or currencies to a single Vendor Bill.",
"id": "",
"stack": [
"anonymous(N/serverRecordService)",
"postBill(/SuiteScripts/new_post_transaction.js:1402)",
"doPost(/SuiteScripts/new_post_transaction.js:641)"
],
"cause": {
"type": "internal error",
"code": "YOU_CANNOT_ADD_MULTIPLE_VENDORS_ANDOR_CURRENCIES_TO_A_SINGLE_VENDOR_BILL",
"details": "You cannot add multiple vendors and/or currencies to a single Vendor Bill.",
"userEvent": null,
"stackTrace": [
"anonymous(N/serverRecordService)",
"postBill(/SuiteScripts/new_post_transaction.js:1402)",
"doPost(/SuiteScripts/new_post_transaction.js:641)"
],
"notifyOff": false
},
"notifyOff": false,
"userFacing": false
}
Please help.raghav
01/26/2024, 11:57 PM