Discussions
Transaction Line Item Commit
We used the code below for several months and it worked perfectly fine. All it does is mass-update the tax code on an Estimate form.
function FlipTaxesG5()
{
var itemcount = nlapiGetLineItemCount('item') ;
for (var x = 1; x <= itemcount; x++)
{
nlapiSelectLineItem('item',x);
nlapiSetCurrentLineItemValue('item', 'taxcode', 39517, false, true);
nlapiCommitLineItem('item')
}
alert("All line items have been switched to G5.");
}
A little while ago is stopped working. It would only change the tax code on the first line. When I added a debug mark (simple line item alert) it started working again (as seen below). It seems to be related to some refresh or focus that the alert message is causing. Unfortunately I can't exactly deploy a script that causes 10-20 alerts each time it is run.