Hi. Anyone has experienced working with tax detail...
# suitescript
n
Hi. Anyone has experienced working with tax details on VB? I am using the following code but I am unable to set the tax code. It says invalid value for the ID of the tax code. I can set it in the UI and have loaded a saved VB. It has the same value as the value I am entering for tax code.
Copy code
vendorBillRec.selectNewLine({sublistId: 'taxdetails'});

vendorBillRec.setCurrentSublistValue({sublistId: 'taxdetails', fieldId: 'taxdetailsreference', value: `NEW${1}`, line: 0});
vendorBillRec.setCurrentSublistValue({sublistId: 'taxdetails', fieldId: 'taxtype', value: taxCodeMap.taxtype, line: 0});
vendorBillRec.setCurrentSublistValue({sublistId: 'taxdetails', fieldId: 'taxcode', value: parseInt(taxCodeMap.taxCode), line: 0});
vendorBillRec.setCurrentSublistValue({sublistId: 'taxdetails', fieldId: 'taxbasis', value: netAmt, line: 0});
vendorBillRec.setCurrentSublistText({sublistId: 'taxdetails', fieldId: 'taxrate', text: taxCodeMap.taxRate, line: 0});
vendorBillRec.setCurrentSublistValue({sublistId: 'taxdetails', fieldId: 'taxamount', value: taxAmt, line: 0});

vendorBillRec.commitLine({sublistId: 'taxdetails'});
Ignore line: 0 part. I have logged taxCodeMap it has the values that I am expecting.