Proper usage of "The specified field has been changed from any to another" option

I created a Method BPM on Erp.JobEntry.Update / Pre-processing.

The first condition I have is

The ttJobHead.ReqDueDate field has been changed from any to another

What I have found is if I use the Epicor user interface to update the ReqDueDate, the condition works fine.

However, I have a Data Directive BPM that update ReqDueDate via Custom Code. If I run the
JobEntry.Update in the Custom Code, the condition in the Method BPM will not trigger. Any ideas?

Doesn’t the Standard data directive fire after the change to the data on the db?

If this is the case an you have a Preprocessing on the Update then the horse has already bolted and changing in code won’t fire the preprocessing BPM…

The other thing also is if you are just updating the data and not actually calling the update method from the directive it would not fire either.

Try just putting a message on the pre processing and the data directive and see what comes first.

What are you trying to acheive?

The Data Directive is from another table, it is monitoring a field in a UD table.

The Method BPM will fire, but I cannot use the condition “The specified field has been changed from any to another” to track changes on the ReqDueDate if I have custom code that call the JobEntry Update.

Thanks for the clarification…what is the field changing from-to? nulls ring a bell

It depends on what your custom code is doing. Of you are calling the BOs to do the update, it should fire. If you are using linq or some other method to bypass the BO and go directly to the database, then you won’t get it to fire. That’s one of many reasons why you want to use the BOs whenever possible.

“Method” BPMs only trigger if you actually use that method to do the update… in you example, you have your BPM on JobEntry.Update… so if you updated the Data by calling the JobEntry.Update, (OR JobEntry.UpdateEXT), and if you changed the date, it would have triggered your BPM… but if you simply did a change to the date by writing directly to the data via C#, and you didn’t call the method, then it will not run, because it was never called…
On the other hand, you CAN capture this type of change nearly every time by moving your BPM logic to the JobHead. In-Trans Data BPM… basically this captures the change any time the jobhead is modified.
But note: this can have some strong bad speed issues… note that I said “EVERY time”. this means that when MRP is running, it creates a job, it will trigger your BPM, and if your BPM is slow, then you will slow down MRP. One way around this is to make sure you have proper conditions that prohibit it from triggering when certain users or during specific times of the day, or “only for FIRM jobs”…

1 Like

So a data directive will fire even if you went directly to the database?

I am using Update in the Data Directive Custom code.

The Method BPM do fire, however, I cannot use “The specified field has been changed from any to another”

So I have done a Messagebox to show me the info when I change the data via UI

image

And if I run the Data directive via C# code that calls Update.

image

And I think this is why the Method BPM fires, but the condition “The specified field has been changed from any to another” didn’t work. Maybe it is because it only has 1 row.

So what I have done in the PreProcessing of the Job Entry is to compare the ReqDueDate with data in the database instead of using “The specified field has been changed from any to another”.

1 Like

The Epicor Client manages the data using the standard MS dataset technology. The MS dataset manages an original row and a proposed row - the one marked with a RowMode “U”. Both rows are maintained until the changes are “accepted” (that occurs when the Update returns from the Server with no errors).

When the Client returns the modified data to the server, both the original row and the modified row are returned and that is how BPM can compare fields to see if they have changed. The Original row has an empty RowMod value while the Updated row will have a RowMod of “U”.

Can I ask if there is a way to mimic this behavior if I do custom code in BPM and run the Update method?