JobEntry.Update Not Updating Part of Dataset in Function

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.

Data

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.

FWIW. If I changed the function call in the Standard Data Directive (I left that part out of the original post) to be asynchronous instead of synchronous, the JobProd record was successfully added, and the other Job tables that needed updates (JobPart, JobHead, JobAsmbl) were all updated successfully. I can only assume something about the synchronous call was interfering with the JobUpdate Method?

Since I needed to send info back to the directive to display for the user, I moved the function call to a Post-Processing Method Directive. This allowed for the JobProd record creation and the associated tables to be updated as intended.