when trying to get the internal id of a tax code i...
# suitescript
m
when trying to get the internal id of a tax code it's returning me a value I don't recognise: inside my loop: var tax_code = so.getLineItemValue('item', 'taxcode', i);
Copy code
for (var j = 0; j < record.length; j++) {
        var internal_id = record[j].getValue('internalid');
        var so = nlapiLoadRecord('salesorder', internal_id);
        var line = so.getLineItemCount('item');
        for (var i = 1; i <= line; i++) {
            var tax_code = so.getLineItemValue('item', 'taxcode', i);
            console.log('Line Tax ID Is: ' + tax_code);
            so.selectLineItem('item', i);
            if(tax_code == 22142) {
                so.setCurrentLineItemValue('item', 'taxcode', '27489');
                so.commitLineItem('item');
                nlapiSubmitRecord(so);
            }
        }
    }
Full loop running in console. Internal Id should be 5 character length but the tax code it's printing is 4 character length - no idea why