Hello, I’m trying to update the status of a Purcha...
# general
i
Hello, I’m trying to update the status of a Purchase Order in a UE script (afterSubmit). I’ve tried to do submitFields, setValue and setText (the two last loading the record). I’ve tried with the field ‘statusorder’ (with values: ‘PurchOrd:G’ and ‘G’) and the field ‘status’ (with text/value ‘Fully Billed’). So far, no success. Any ideas how to make it work? Do I have to change both fields at the same time?
n
You cannot just update the PO status using script. It is updated when certain events occur like item receipt and vendor bill being created.
i
Thanks for the info. Extra question: In the UE script I’m creating the bill from the PO (with record.transform). Shouldn’t that, then trigger the change in the PO? 🤔
n
It should but you will probably need to create the item receipt as well.
Sometimes you create the bill but the PO still shows as Pending Receipt.
i
ok, thanks for the input. I’ll keep investigating it
l
You may also want to check if the Bill In Advance of Receipt accounting preference is enabled. If it's disabled, it should not allow you to create a Vendor Bill prior to Item Receipt even through scripting (theoretically).
t
You will continue having the status of pending receipt until you have enough item receipt transactions to have received every item on the PO.
i
Thanks for the extra input! Yeah, I was fearing that the “pending receipt” was not going to change even if I can associate a bill to the PO. Great to have a confirmation!