Hi all,
I'm trying source details from the Sales Order and Work Order when creating an outsourced Purchase Order. I want to be able to attach the customers delivery address from the SO to the PDF of the PO that gets emailed to the manufacturer.
Does anyone have a way to do this?
I tried building a UE script which I have attached, but it appears the WO isn't attached to the PO in the item line until after afterSubmit. This is functionally useless to me because I want to use that address on the PO Document that is emailed to the manufacturer so it needs to happen during afterSubmit on Create at the least.
The script does work if I simply run it again after the PO has been created, but by this point the email should have already been sent.
Notes:
There is no value in the createdfrom field of the outsourced PO.
It's odd that despite the PO being created from the WO, the PO can't be deleted first stating it has related records. The WO has to be deleted before the PO.
Example process including the script functionality so far:
SO Is raised and we click Create WO on the assembly item line.
WO is raised with the outsourcing charge and vendor set.
After the WO is created we then click Create PO
The PO is created, but in my example from the script the fields have not been filled. There is also no 'Created From' field despite it being set to show. The xml view also says there is no data in this field.
If I edit and save the record, the fields are then filled.