BPM Help

Epicor 10.1.600.8

I wrote a BPM for the quote entry screen that is throwing an exception message when the user clicks on the ‘quoted’ checkbox but the ‘engineered’ checkbox is false on the line level, the BPM is firing and the exception box comes up, but for some reason the ‘quoted’ checkbox remains set to true. The BPM is a pre-proc in the Quote BO. I have tried the BPM in the ‘Update’ and ‘GetQuotedInfo’ methods and get the exception box but the ‘quoted’ checkbox remains true. I even tried setting the ‘quoted’ checkbox back to false in my BPM which also does not work. The end goal is when a user checks the ‘quoted’ checkbox, the BPM needs to check if any of the ‘engineered’ check boxes are false for each line, if any of them are the BPM needs to raise the exception and prevent the ‘quoted’ checkbox from being true until the user goes back and marks the ‘engineered’ checkbox to true for any of the lines.

Below is my code

When you set the value back in your BPM are you commiting it?

Db.Validate();

Using the Db.Validate after setting the value does not fix it. The ‘quoted’ checkbox still shows as checked. My code is in my first post btw.

Temp tables are cleared out before a post processing call happens. You will want to go after the actual record in the database, not the temp table. You can do this by passing your quote values into either BPM variables or call context variables in the pre-processing, then performing your lookup in post against the database using those variables.

1 Like

My BPM is a pre-proc not a post-proc. I stated I tried both of them to see if it would make a difference but it seemed not to.

Try this style (modified to your needs)

using (var txScope = IceContext.CreateDefaultTransactionScope())
{
 foreach(var UD01 in (from row in Db.UD01.With(LockHint.UpdLock) where
 row.Company == Session.CompanyID && row.Key1 == "12345"
 select row))
 {
  UD01.ShortChar01 = "abcde";
 }
 Db.Validate();
 txScope.Complete();
}

Try setting the field before the exception.

1 Like

So it looks like the BPM is doing what it is supposed to do, however I discovered this by refreshing the screen and noticed that it cleared the checkbox for ‘quoted’. Now I tried using the below code to refresh the screen and I did bring in my Assembly so I do not get an error. But for some reason the below code will not refresh the screen, any ideas?

             Erp.Contracts.QuoteSvcContract Quotesvc =
             Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.QuoteSvcContract>(Db);
             QuoteTableset QuotePDS = new QuoteTableset();
             QuotePDS = Quotesvc.GetByID(QuoteDtl.QuoteNum);
             this.dsHolder.Attach(QuotePDS);

A screen event will be independent of a server side event (BPM). You might be better off preventing this via Form Customization rather than BPM if you need the UI to be responsive to the logic .

1 Like