Can a BAQ call BO.Method?

I need access to a calculated field(InvcHead.DspDocSubTotal & InvcHead.DocDspTaxAmt) that ARInvoice.GetByID returns, but the data does not exist in the database. I can use the REST APIs to do this, but I’m trying to learn how to use the Epicor tools(@josecgomez - thanks for the advice!). I’m thinking it would be really cool if I could call a BO.Method from with in a BAQ, but don’t see any option for this.

What is the right way using the Epicor tools to get access to this type of data(doesn’t exist in the DB, the BO.Method returns the data)?

You can call a BO Method in a BAQ but it needs to be UBAQ, you can call it in GetList post processing.
However if you are already in a BAQ you can just make your own SubTotal and Tax
They are just a Sum of the InnvoiceDtl and InvcTax tables.

1 Like

@josecgomez thanks!

Sounds like a clever solution.

If I’m understanding correctly. I create a UBAQ, with a blank calculated field (where I can add a comment that the blank field is populated via a method directive). Then create a post processing method directive on the BAQ BO.GetList() method where it has criteria to only run on the UBAQ I just created. The method directive calls the BO.method I want access to and writes the resulting field to the UBAQ blank field. Am I on the right track?

Thanks!!!

Yeah, create a blank calculated field in the UBAQ, then in Post Processing GetList() you loop through the results make your call and update that Calculated field with the value.

Note this approach is pretty slow if you have a lot of results… Hence my recommendation of looking a the InvcTax table etc instead since you are already server side.

@embedded , the BPM in actually IN the ubaq. You don’t go to method directive maintenance. You get to it from inside the BAQ

2 Likes