I am working on a function called from a BPM that creates a Make To Order JobProd record to an existing Job, but I am running into an issue with the JobPart table not being updated during the update call.
In the function, I am successfully retrieving the Job, creating the JobProd record and inserting the necessary data to link it to the Sales Order.
The issue is that the JobPart.PartQty is not getting updated to a quantity of 1 during the update as it does when adding the demand link manually in Job Entry. The trace I gathered performing the manual steps does not have any extra calls between ChangeOrderRelNum and Update. As shown in the data below, Job RPR416565 was created manually, and all data is correct. RPR415658 was created with my function and the Part Quantity is 0. RPR414535 was created by my function and then the demand link was deleted in Job Entry which results in a -1 in the Part Quantity field and results in an error being received when accessing the Job in Job Entry.
At my previous employer, Service Connect was being used to create the same type of JobProd record and the JobPart table was not explicitly updated in the workflow, it just happened during the Update as it does when performing the steps manually. I realize Service Connect and Functions are different, but I don’t understand why the JobPart table isn’t getting updated.
I’ve thought about adding another Set Field widget to my function and forcing the change to the JobPart.PartQty field before Update is called, but I wasn’t sure if that was the best path forward in case something else is being missed in the update.
Has anyone experieced this before? If so, how did you proceed? Thanks in advance.