Marwan
12/19/2022, 10:16 AMlet taxcode = record.create({
type: "salestaxitem",
isDynamic: true,
});
taxcode.setText("nexuscountry", "EG");
taxcode.setValue("itemid", "VAT " + vatstr + "%");
taxcode.setValue("description", vatstr + "%");
taxcode.setValue("rate", vatstr + "%");
taxcode.setValue("subsidiary", "10");
taxcode.setValue("taxagency", "16612");
taxcode.setValue("taxtype", "1"); // VAT_EG
taxcode.setValue("service", true);
taxcode.setValue("export", true);
taxcode.setText("available", "BOTH");
taxcodeID = taxcode.save();
But I am getting an unexpected error without any useful details
Error at suitescript/resources/javascript/record/recordImpl.js:40:12 at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js:38:24) at suitescript/resources/javascript/record/recordImpl.js:26:29 at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js:24:24) at <http://Object.post|Object.post> (/SuiteBundles/Bundle 364366/rl_salesorder_ns_sync.js:919:32)
Something a little bit weird, is that, the line 919 is the create()
line, not save()
Is creating tax codes programmatically allowed?Stuart Anderton
12/19/2022, 11:33 AMMarwan
12/19/2022, 11:38 AMTax Records
under Lists
I guess it is not allowed to create one using scripts.Stuart Anderton
12/19/2022, 11:46 AMMarwan
12/19/2022, 11:48 AMSALES_TAX_ITEM
but not allowed with creationMarwan
12/19/2022, 12:02 PMSALES_TAX_ITEM
for the first time, you will get an error that you have to set list permission for tax records. I am not sure if they are the same thing.battk
12/19/2022, 2:03 PMbattk
12/19/2022, 2:04 PMbattk
12/19/2022, 2:08 PMMarwan
12/19/2022, 2:14 PMlet taxcode = record.create({
type: record.Type.SALES_TAX_ITEM,
isDynamic: true,
defaultValues: {
nexuscountry: "EG",
},
});
Marwan
12/19/2022, 2:14 PM