Discussions
Create PO from Script
This is doing my head in I am trying to create a PO from a SO, however I am having the same issues everyone else seems to have "Exception Thrown and not caught". I have broken it down and simpified it for the purpose of this post, the code I have is
var record = nlapiCreateRecord('purchaseorder');
record.setFieldValue('entity', 32 );
record.setFieldValue('currencyname', 'US Dollar');
record.setFieldValue('customform', 107);
record.setFieldValue('exchangerate', '0.74');
record.setFieldValue('trandate', '26/3/2009');
record.setLineItemValue('item', 'item', 1, 21);
record.setLineItemValue('item', 'quantity', 1, 10 );
record.setLineItemValue('item', 'price', 1, 1 );
var id = nlapiSubmitRecord(record, true, false)
Why doesn't it work, does some one have a guide as to what fields I need to complete, I have completed all the mandatory fields for the main section.