Have a BPM Fire Another BPM


I have the code below in method IssueReturn.PerformMaterialMovement / Pre-Processing

if(dUsedWgt > dHighWater ) 
     foreach (var UD40_iterator in (from UD40_Row in Db.UD40.With(LockHint.UpdLock)
                                            where UD40_Row.Company == Session.CompanyID
                                            && string.Compare(UD40_Row.Key1, "CoilQtyAdjustment", true) == 0
                                            select UD40_Row))
                 UD40 = UD40_iterator;
                 UD40.ShortChar02 = lotNum.ToUpper();
                 UD40.CheckBox01 = true; 

I am updating UD40.CheckBox to true, because I have another BPM at UD40.Update that is looking for when the CheckBox01 is set to true so it knows to fire.

I can see that the UD40.CheckBox01 is set to true in SQL, so I know that IssueReturn.PerformMaterialMovement / Pre-Processing is firing correctly, but UD40.Update BPM is not firing.

I have tried to surround the code above with

using (var txscope = IceDataContext.CreateDefaultTransactionScope())

as mentioned in Epicor10_ConvertedCode_ProgrammingGuide_102100.pdf" pg 45, but UD40.Update BPM with not fire.

How do I get UD40.Update to fire when method IssueReturn.PerformMaterialMovement changes UD40.CheckBox01 to true.

From your code posted, you are updating UD40 with the Db context.
That will not cause UD40.Update to fire.

Also, not seeing it your code, but maybe it is just not included, but there is
no Db.SaveChanges()

If you need UD40.Update to fire, you will need to update UD40 with the business object,
not the Db context.

agree with @klincecum here…

  1. you are updating the data… true… but
  2. you are NOT calling UD40.Update method… the BPM is only run when that method is called, which then triggers it to run.

You can create a DATA BPM on UD40, which then doesn’t care what process actually did the update.

This is more in line with what I want. I didn’t write the other BPM, so let me see if I can migrate it.

I’ll consider this the answer.

After testing, this was the answer.