External BAQ (OData) logging

,

I have a BPM that logs when BAQs get executed so I can gather information as to what BAQs are stale or obsolete. I would love to know when one is being executed by the BaqSvc in Rest. The BAQ gets logged, but I can’t tell if it’s within Epicor or if it’s through the BaqSvc. I might be missing something simple, but it eludes me. Any ideas on how I could capture this?

1 Like

Use CallContextClient to figure out the DLL it’s being called from should be blank / bill via rest

I was just thinking about doing this yesterday. Listening…

IIRC, it’s blank no matter what. Let me test.

EDIT: @josecgomez, it does work, but the issue I have is I can’t tell if it is executed in the BAQ designer (Test/Get List) or via the REST. In the case of the designer and REST, the DLL is blank. We do have some that design and then use BAQs in Excel, but maybe this can get me 80% there.

What about the REST of the CallContextClient there would likely be nothing (null) in CallContextClient if its REST but there should be “something” for BAQ Designer.

I changed the BPM to record the AssemblyName in Character01 in a UD record. I got an error. Just running the BAQ designer, I get the following error:
image

If I change it to:

callContextClient.AssemblyName ?? string.Empty;

Then that error goes away. So it’s NULL for both the BAQ Designer and REST.

What about CallContextData again it should be null for REST.

Ok, I made an assumption - incorrectly.

I changed it to:

callContextClient.AssemblyName ?? "NULL";

When I run the REST, it’s blank, when I run it in the Designer it’s “NULL”. So that’s my solution. I was assuming it was NULL for both.

So now it’s working:
image

EDIT: It’s also NULL for BAQ Reports

1 Like