How to approve a Purchase Order using SuiteScript
Hi guys,
How do we approve and change the approval status of Purchase Order using Suitescript ?
var purchaseOrder = record.create({
type: record.Type.PURCHASE_ORDER,
isDynamic: true,
defaultValues: {
entity: "12345"//vendorId
}
});
purchaseOrder.setValue({
fieldId: 'approvalstatus',
value: 2
ignoreFieldChange: false
});
var purchaseOrderId, = purchaeOrder.save();
I also tried to submitFields after creating the purchase order using the following, but it doesn’t work either.
record.submitFields({
type: record.Type.PURCHASE_ORDER,
id: purchaseOrderId,
values: {
'approvalStatus': "2"
}});
Please note, that Netsuite Approvals workflow suiteapp is installed.
Any Ideas Guys.
Much appreciated
Hi Guys,
I found out the answer.
'status':'B'
Thank You
hi, cool. How do you resolve the issue?
I need to approve a purchase order using the approve button action through suitelet script on NetSuite. NetSuite Approvals workflow SuiteApp is installed. Any suggestion?
hi, cool. How do you resolve the issue?
I need to approve a purchase order using the approve button action through suitelet script on NetSuite. NetSuite Approvals workflow SuiteApp is installed. Any suggestion?



