Is it possible to assign an External ID to tax cod...
# general
l
Is it possible to assign an External ID to tax codes through scripting or any other means?
b
This will be possible by scripting, you can get the value of the externalid in the script, and then assign that value to where you want.
l
require (['N/record'], function(record) { var rec = record.load({ type: record.Type.SALES_TAX_ITEM, id: 1 }); rec.setValue({ fieldId: 'externalid', value: 'T1' }); rec.save();
I tried the code above in the console but it didn't work. By any chance, do you know what's wrong with it?
b
This is similar, and I have this working on my account. define(['N/currentRecord'], function(currentRecord, dialog, log) {     /**      *      * @NApiVersion 2.0      * @NScriptType ClientScript      */         function saveRecord (){     var objRecord = currentRecord.get();     var costcentre = objRecord.getValue({         fieldId: 'entityid'    }) objRecord.setValue({                 fieldId: 'externalid',                 value: costcentre,                 }); return true; } return { saveRecord: saveRecord };});