External BAQ, pass return value in Method Directive using DynamicQuery

Have successfully created an External BAQ in Epicor that reaches out to SQL database table and returns a single value:
BAQ_result

I have then created a post-processing method directive where I’m trying to execute this external BAQ and pass the result into a variable. I’ve added the “Invoke BO Method”, calling the “Ice.DynamicQuery.ExecuteByID” with specified parameters.

The parameters queryID, executionParams, and return value:

The QueryID and return value are pretty straightforward…but what is supposed to go into the executionParams? The dropdown in that field allows for creating a new variable or creating a new expression. Just not sure what this is expecting.

Trying to use the widget for dynamic query is kind of a pain . It’s easier in code. You need to get the execution parameters first. If you don’t have any parameters I think you might be able to leave it unspecified.

Check out this thread.

1 Like

Thank you Brandon…I’ll give this a try and see how it goes. I was hoping to avoid having to code the BAQ call.

Oh, meant to mention. If I leave the executionParams as [unspecified] (using the widget), I get an error of Element: Invoke BO Method 2; Description: Business object method parameters not mapped: ‘executionParams’.

Is there a parameter you need to use?

Not in the BAQ, no. It’s filtered to only return a single value already. It can run wide open and return the value I’m after.

Did you try and create new variable in the wizard? Don’t do anything with it though. Just so you have an empty object of the correct type to send.

I think you have me almost there. I can see the BAQ getting executed.

That dataset should be just a single value passed back. How do a assign that value to a variable or a BPM data field? Tried this but received an error, so I must be using the wrong “passing” value:

I think you’ll be looking for something like NextPartNum_Dataset.Tables[0].Columns[0].ToString()

Basically your variable is the a whole data set, you need to get out the row and column you want, even though it’s only one.

1 Like

I commend you for trying to use the widgets but those things are evil! lol

2 Likes

lol-- wish we had a lol button instead of just a like…

You know what Ken… we can make that happen #HoldMyBeer

5 Likes

where is this popup? that is looking for a string type.

The results are a table you need to specify the field in the table to see the results, which is what @Banderson was saying.

wait wait wait. you aren’t passing any variables correct?

Then use the GetByID method.

BOOM. Thank you so much Brandon! This was the BAQ output:
BAQ_result

…and this is what ended up being the syntax:

…and the result:
display

Agreed on the widgets being evil!

1 Like

Just saw this…let me give this a run as well…

You’ll just get back an empty set, so you shouldn’t need it.

Never mind, I was thinking you were still talking about the execution parameters.

I don’t think the GetByID brings back the data. Let me look :thinking:

1 Like

lol… you knew without knowing. you are now MASTER!!!

I think the ExecuteByID should have an ignore option for the execution data set.

image

GetById brings back data.