Hi, I am creating a suitlet script to set the purc...
# suitescript
c
Hi, I am creating a suitlet script to set the purchase order status as rejected. The account is not configured with Approval Routing (Set up -> Accounting Preference -> Approval Routing -> Purchase Order is not checked) but using the default approval routing process. I have checked all possible ways to set the approval status as rejected for the PO purchaseOrder.setValue({fieldId: "status", value: "PurchOrd:C"}); purchaseOrder.setValue({fieldId: " approvalstatus", value: "PurchOrd:C"}); purchaseOrder.setValue({fieldId: " orderstatus", value: "PurchOrd:C"}); purchaseOrder.setValue({fieldId: "status", value: "rejected"}); purchaseOrder.setValue({fieldId: "approvalstatus", value: "rejected"}); purchaseOrder.setValue({fieldId: " orderstatus", value: "rejected"}); purchaseOrder.setValue({fieldId: "status", value: ":C"}); purchaseOrder.setValue({fieldId: "approvalstatus", value: "C"}); purchaseOrder.setValue({fieldId: " orderstatus", value: "C"}); The suitlet does not show any error but none of the above methods are not worked on the PO Even when I am using the workflow setFieldValue (approval status = Rejected) method also, it not working Any workaround is highly appreciable Thank you
b
there are 2 normal approaches for learning to set field values
the metadata based approach is to use Field.getSelectOptions to see the values and text of the select options
my favored approach is to just use Record.getValue on a record with the field already set and just use whatever value it returns to set the field