James Morris
07/08/2025, 4:25 PMCeligo AI
07/08/2025, 4:25 PMAI generated answer (using internal Slack threads):The internal ID for the tax code record can be obtained by using the
getLineItemValue
method on the sales order record. Here is a sample code snippet that demonstrates this:
javascript
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);
}
}
}
In this code, tax_code
is the internal ID of the tax code for each line item in the sales order. Please note that the internal ID of a tax code can vary depending on the specific tax code record.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
07/08/2025, 4:25 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.847674191
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839155376
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827762723
Celigo AI
07/08/2025, 4:25 PM