RE: 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

nadeemkhoury Rookie Asked on June 6, 2020 in SuiteScript.
Add Comment
1 Answers

Hi Guys,

I found out the answer.

 

'status':'B'

 

Thank You

Rookie Answered on June 7, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.