Hi all, We are having issues when using the commit...
# suitescript
g
Hi all, We are having issues when using the commit line API call to add a new line to sublists on our Sales Order. The commit line is being called in asynchronous code. After the api call, the line is not fully committed. The field values are populated, but the user must still click the ‘Add’ button to commit the line manually. This is my code:
Copy code
function customrecalc(type)
{

  if(type == 'item')
    {
      var itemId = nlapiGetCurrentLineItemValue('item', 'quantity');
        if(itemId > 100)
        {

                //Insert item
                nlapiSelectNewLineItem('item');
                nlapiSetCurrentLineItemValue('item', 'item', "REV0007");
                nlapiSetCurrentLineItemValue('item', 'quantity', 1);
                nlapiCommitLineItem('item');

	    }
    }
    return true;
}
Thanks
b
use the synchronous paramater