I am trying to do something which I though was ver...
# suitescript
p
I am trying to do something which I though was very simple - change the Cost Estimate Type when an item is added to a sales order. I have the below but the change is not happening:
Copy code
if ((type == 'item') && (name == 'item')) {
	 console.log('Changing Cost Estimate Type');
	 nlapiSetCurrentLineItemText('item','costestimatetype','Custom');
 }
Is it not possible to change the costestimate type via script?
b
code looks fine
make sure you are setting it after sourcing is complete
otherwise its being overwritten
you should be using postSourcing