Try to decide if an external BPM is worth the effort and cost

I think I see what I did, I need to put the Post-Processing BPM in the correct method, I put under the FieldUpdate instead of the GetList. Thanks for the prompt feedback.

1 Like

For the DynamicQuery BO call, does it matter if I use ExecuteByID or GetByID?

Well the GetByID only allows for the QueryID and returned dataset. So that answers that question.

For test3, I completed the preliminary BPM for the Quote Update to Call the BAQ using the Dynamic Query. I verified I think that when the Quote Line price is change the screen BPM is trigger, and Dynamic Query calls the BAQ. I did this by not specifying a parameter value to the BAQ, to which I received a message of no value is specified. Then I added a BAQ parameter value in the Dynamic Query call and test it again, this time no message is displayed about the value or anything. It should trigger the Special BPM which current has a message set in it.

In addition to the BAQ BPM GetList method, I added the update and it still would not trigger.

When I run the BAQ using the direct UI the BAQ BPM will trigger and display the test message.

Ok, I resolve the first issue, by changing the BO method Dynamic Query for the Quote Update from DynamicQuery.ExecuteByID to GetListByID. Now I see the message. However, I am still having issue setting the parameter values.

Iā€™m trying to pass the parameter from the Quote BPM to the Dynamic Query BAQ. The BAQ required one parameter the QuoteNum. I am setting the following ParamsTableSets using the Set Field Widget(s):

ExecutionParameterIsEmpty = false
BAQID = ā€œBAQ name/idā€
ExecutionParameterID = BAQ Parameter Name
ExecutionParameterValue = QuoteNum
ExecutionParameterType = ā€œintā€

I attempted to match the trace log when running the BAQ through the interface:

    <parameter name="executionParams" type="QueryExecutionDataSet">
      <QueryExecutionDataSet xmlns="http://www.epicor.com/Ice/300/BO/DynamicQuery/QueryExecution">
        <ExecutionParameter>
          <ParameterID>BAQParamQuoteNum</ParameterID>
          <ParameterValue>7280</ParameterValue>
          <ValueType>int</ValueType>
          <IsEmpty>false</IsEmpty>
`

Your going to have to go through all of the steps that you have to go through when you do it in code. Youā€™ll have to get a query execution data set, then modify it. Thatā€™s where your parameters are housed.

That being said, Iā€™ve never been able to make dynamic query work with the widgets either. Thatā€™s why it was suggested to do it in code.

Do you mean C# block from the BPM or Screen Customization?

BPM block is what Jose would do. Iā€™m not good at server side code though.

Thx. I will try your suggestion tomorrow.

1 Like

Thank you both. I will try it today.

Just so that I understand the progressively elaborated plan, the code provided will run the UBAQ and get the results then, We can Call the BAQ to update the results. Correct? If so,

  1. The code provided and modified for my case, does not trigger the UBAQ (Special BPM) which is suppose to put-out a message. But later will be modified to call the Sales Order business object to update the price.

  2. If any error is currently occurring, will it be displayed on the screen or be written in a server log somewhere?

As I suspected, I was able to display the error on the screen during execution/testing using:

Epicor.Customization.Bpm.InfoMessage.Publish ("MGA - BPM: " + e.Message );

The error message: 
Information Message Detail:
============
Version: 0
Program: Erp:BO:Quote/QuoteSvcContract/Update
Method: 
User: 
Company: 
Site: 

Message: MGA - BPM: There is no BPM customization attached to Update method of MGA_UpdateSalesOrderLinePrice updatable query in PSI company or BPM system is not enabled.
Please check presence of BPM customization and/or ask administrator for assistance.
Severity: Information

`

The UBAQ (BPM) under the advance method is enable in two methods, the GetList and Update.

I realise Iā€™ve come in late to this discussion and might be hijacking it, but when Iā€™m faced with needing this approach this is how I tackle it. There are other ways and may well be better ways.

First, create a uBAQ that does what you need done. You rarely need a UD table involved, because you can probably get most of what you need into the result set directly by using parameters. Then add whatever you need to the Update method to make the changes you want based on what is entered into the updateable fields of the BAQ. The nice thing about doing it this way is itā€™s easily testable.

Then, once the uBAQ does the right job, you can use the code I gave you in a BPM on the other part of the system. You call the uBAQ with the right parameters, update the result set just as you would in the BAQ designer, and call Update. That fires your already-tested method.

Thereā€™s no technical reason why you canā€™t have whatever you like happen in any other BAQ methods, but Iā€™ve never had much success going that route because there seem to be obscure rules to when they fire that I havenā€™t figured out. Plus I concluded that the above approach is easier to maintain in the long run.

Sorry if thatā€™s too much detail - TLDR: get your BAQ working as you want first before using it in a BPM.

1 Like

Thank you. I agree your solution sounds much easier to develop and maintain. I will circle back after changing my approach.

Works very well.

2 Likes