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 Beginner Asked on June 6, 2020 in SuiteScript.
Add Comment
2 Answers

Hi Guys,

I found out the answer.

 

'status':'B'

 

Thank You

Beginner Answered on June 7, 2020.

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?

on December 3, 2024.
Add Comment

Your Answer

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