BPM to copy UD field from OrderRel to JobHead

I need a few custom UD columns in OrderRel table to send the value entered all the way to JobHead table. How would I setup a BPM to do this?

Trace your process in manual mode to identify the methods. Trap the method you want to trigger off of and setup a method directive. Alternatively, you can set a data directive. Both will give you the BPM designer to use. From there use an update table by query widget to push your data up to JobHead.

1 Like

On the data directive, JobHead table, what would the update table by query widget need to include? Also would it be a standard or in-transaction?

From Help: Data Directives

There are two types of data directives:

  • In-Transaction - Affects data before it is saved to the database. This directive type can only process one row at a time; it cannot process multiple dirty rows - rows that contain data not yet saved to the database. Multiple dirty rows are explained in the BPM Workflow Designer > General Principles section within the application help.

  • Standard - Does not affect data in the database. A Standard directive executes after a data transaction is saved to the database. This directive type processes multiple dirty rows modified in the database at once. It runs after base methods and method directives. They are intended for audit purposes, for example they can write some information to log.

Based on this, I think the standard is the right approach. But In-transaction might be easier. I am not a pro with directives, but I would start with a condition, and then the update table by query. In this query, you want to link your order release to your job using the JobProd table. Then update the rows in ttJobHead mapped with a job number link, and your custom field. For example JobHead.Character01 = OrderRel.Character01.

I hope this helps! It always take me some trial and error to get these directives working. Good luck!

1 Like

@ypgpatel I do this in an in transaction on JobProd since it is related to the order/line/release and the JobHead. JobHead can exist without a JobProd, but JobProd can only be added if there is a Job.

Now this direct link will only work if the JobProd is make to order. If you are doing make to stock then JobProd will have an ordernum of 0. I added order/line/release UD fields to JobProd for these to allow the same type of lookup on change of the UD fields.

2 Likes

Do you have screenshots of how you setup the query and the mapping to do this?

@ypgpatel No, it is all code and there are twenty fields we do this with. The condition is that OrderNum is more than 0.

No worries, thank you for the suggestion. This helps to get something in the right direction put together

If you had a quote, prior to the order, you could use the User Defined Column Map, which requires no code and will copy data between UD Fields

1 Like

We do have quotes prior to order. How does User Defined Column Map work? What do I need to do on there to get the fields to link?

You need tp set up the UD field mapping
this is in System Setup>System Maintenance>UD Column Map

that does not appear to be a direct link from order rel to job head, but there is one from quote to job, if you get the details from the quote