Copy value of field to different table BPM

Hello!
Looking for advice about UD fields and calling them in different tables.
I created a few UD fields on my OrderRel table that allow us to put in customer truck information and expected date. We can’t start a job until their truck is in our possession. This information is almost always obtained during Order Entry.

I wanted this information also to be visible on the job that is linked to this order (we do everything make to order). I can’t see the OrderRel table in the EpiBindings - so I thought I’d make duplicate fields on the JobHead table. But now I can’t figure out how to keep the JobHead table in sync with the OrderRel table.

Should I be trying to sync two columns in two tables or can I somehow set up a field on the job to see the OrderRel field values? Thanks!

You can use a the foreign key view wizard in a customization to bring in the OrderRel records linked to the job (assuming the job is make to order). I think this would be easier than creating another UD field and keeping it updated.

@dr_dan I do this in a DD when a JobProd record is added or updated. On a MTO you have the order/line/release you need to get the data in the JobProd record.

I was thinking along these lines, but I was hesitant to go that route because I didn’t want to assume that the information would be there at the time of jobprod add/update. If someone added it to the order after the job line was created, I still wanted it to be there when our planner is reviewing jobs to schedule - without necessarily having done an update yet. Maybe I’m thinking too much into it.

I am in the Customization tools dialog. I don’t see a foreign key view wizard. It sounds like what I am trying to accomplish. Could you elaborate a little? I’m learning so many new things lately!

image

You can bring in other data tables into your customization with it. I had issues with using the order line and order rel fields as foreign keys to link with the OrderRel table, so the data directive may be a better solution.

@dr_dan Yes, that would require a method directive on Order Release for those fields changing that checked for an existing jobprod to update, but that is not hard to do.

I was coming to the same conclusion as to where I needed to originate the BPM. However, I am stuck here because I don’t know how to update a field in a different table. When I look to set fields, I only get tables within the Sales Order family. Do I need to do that through execute custom code? If so, what is the magic format that allows me to update a table?

If you use a method directive, you can use the BO widget to call JobEntry.Update or UpdateExt. If you use a data directive, you would need custom code since that widget won’t be available. The code would use some BO adapter to update the tables.

If they always have the information you could have a bpm make those fields required. Then you would only need the MD if there was a change or maybe not at all.

As @Asz0ka says you can use the BO widget. When I am working with UD fields I have a habit of just dropping to code, but I should learn how to use the widgets more so I will try to do this in widgets.

1 Like

This can be done with a Foreign Key View, you just have to create 2 FKVs.
First one is a parent of JobProd, linked to order num, type of Foreign Key View. Select OrderNum for the Like Column.
The second is a sub table view, with a parent of the view created above.
In the subtable view you add 3 Parent / Child View Columns, OrderNum -> OrderNum, OrderLine -> OrderLine, OrderRelNum -> OrderRelNum.

You can keep your data in one spot, reference it any where else and not have to worry about BPMs to sync.

1 Like

Joseph, I ended up using your solution. It did exactly what I was trying to do.

Thanks!