Epicor BPM Update By Query Multiple Records

Hey everyone, I am having some issues trying to get a BPM to work. I am used to programming this in C#, so I am trying to learn how to do it this way. Here is my BPM:

This is what I am trying to do. When the released checkbox is checked, if the job is an FAI, then the fai quantity on each operation is automatically updated. On Job entry I have 2 custom fields, FAI status, and FAI Qty. Fai status is a combo that says if it is an fai or not. FAI qty says how many parts need to go through fai inspection Shown Below.

The BPM “Condition 0” is checking if the FAI Field is set to FAI. IF it is, it continues, if not, it does nothing. “Condition 1” is checking if there is an FAI qty. if the job is an FAI, and there is an FAI qty of 0, then it raises an exception, and tells you to enter a qty. If the qty is not 0, then it goes to update the table. This is where I am having issues. I am trying to update the field “FAQty” for all operations that is on the current job. I invoke the BO GetByID for jobentry adapter. This exports dataset “T”. The update table by query looks like this:

For testing, I am just trying to update all FAQty’s to be 1, just so I know it works. When I run this, nothing is updated, what am I doing wrong?!?!?!

I did similar stuff but I also didn’t know how to do it with just BPM objects (i resorted to c#), If you find a solution, I’d love to see it!

Yeah… That is what I am going to =( I originally designed the form in vb.net (whyyyyyyy). So now I am going through and re-designing it in c#. Figured it would be better in the long wrong, and open up more options if I just redo it in c#. Quick question for you Chris, Do you know how to have an action fire when the job is entered? I want code to fire when a job is entered into the Jobnum field, but can’t find where to put that code. Have you done this before?

We can trigger events on button click, when data is saved to DB (Method or Data Directive BPM) or when data changes on the form (for example key press in a text edit or OnData change of an EpiView).

Tell me which one of these suits you and I’ll offer up additional info.

Sounds like we would do it after the job # field loses focus or better yet on change in the dataview since it probably doesn’t change until the job # is validated,

I’m assuming that you know that you may have to split BPMs between pre and post processing for a lot of problems. (Learned that at insights!)

1 Like

If you want to do multiple records and you re in a version 500+ you can use a local variable as an index and increment that index as you get towards the end, then loop back to a conditional loop and now run the same code for index 1, 2,3,4 etc… and then have a conditional break when it hits whatever number you need.