I want to add new line item in Sales Order based on the particular Inventory item I select. The new line item should be loaded with the existing item record details in it. For this, I used the below code, but its not working;
function recalc(type)
{
var itemId = nlapiGetCurrentLineItemValue('item', 'item'); //Get the Item ID
if(itemId == 16340) //Repair Cost
{
alert ("Hi");
//Insert item
nlapiSelectNewLineItem('item');
nlapiSetCurrentLineItemValue('item', 'item', 330); //Repair Cost
nlapiSetCurrentLineItemValue('item', 'quantity', 1);
nlapiSetCurrentLineItemValue('item', 'amount', '0.00');
nlapiCommitLineItem('item');
}
return true;
}
Can somebody help to rewrite the code in SS 2.0.