BPM calling a function calling a BAQ - BAQ not returning results

I have a BPM calling a function calling a BAQ that is not returning results. The BAQ input is a part number and the output is an average cost. The BPM is a standard data directive that runs when the order detail line is saved.

Function signature:
Signature

Execution parameters:
Execution parameters

Add execution parameter code:

Method parameters:

BPM function parameters:

Get average cost code:

When I test the BAQ I get a result:

But when I save the line in order detail I get an error:

Any ideas on why the data set is empty?

most of the images are lost, only first 2 are shown

2 Likes

Yes, you can’t include images from https://epiccare.epicor.com/sys_attachment.do?etc

Attach the actual images.

1 Like

BAQ returns no results or returns null?

If it me, I’d be writing an Ice.Diagnostics.Log.WriteEvent($“{MyParam}”); first to ensure I was passing what I expected.

4 Likes

Add execution parameter code:
Add execution parameter

Method parameters:
Method parameters

BPM function parameters:
Function parameters

Get average cost code:
Set average cost

BAQ result:
BAQ result

Error:
Exception

If it was returning null, he would get null reference exception, not this.

I would also add server log trace to dump SQL statement of executed BAQ and parameter values

<add uri="profile://ice/fw/DynamicQuery/BaqStatement" />

1 Like

That’s a good suggestion, but unless I misunderstood what he is doing, he is calling a BAQ via code. He should be able to log his param (that he is putting in the BAQParamDS) before calling the BAQ no?

1 Like

sure, you log it before, I log it on query execution. They should be the same if everything is specified correctly. If it is not - this should probably help to know where it when wrong.

1 Like