Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Is it Possible to change the PO Status through Script
Hi ,
I am trying to change the status field of PO through the script once a vendor bill is generated. I am creating the bill from Enter Bills not from Bill Purchase Orders and while creating a bill in one of my custom body field i am selecting the PO#. Script is not showing Any Error but it is not changing the status also.
function AfterSubmit_Bill()
{
var VendorBill = nlapiGetNewRecord();
var POnumber = VendorBill.getFieldValue('custbody14');
nlapiLogExecution('DEBUG','PONumber',POnumber);
var PORecord = nlapiLoadRecord('purchaseorder',POnumber);
PORecord.setFieldValue('status','PurchOrd:G');
nlapiLogExecution('DEBUG','Status1',PORecord.getFieldValue('status'));
nlapiSubmitRecord(PORecord);
var PORecord1 = nlapiLoadRecord('purchaseorder',POnumber);