# External BAQ (OData) logging

**URL:** <https://www.epiusers.help/t/external-baq-odata-logging/99005>\
**Category:** Epicor ERP 10\
**Tags:** baq, bpm\
**Created:** [February 1, 2023, 1:21pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005 "2023-02-01T13:21:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doug.C](https://www.epiusers.help/user_avatar/www.epiusers.help/doug.c/32/26714_2.png) [@Doug.C](https://www.epiusers.help/u/Doug.C)\
**Post date:** [February 1, 2023, 1:21pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/1 "2023-02-01T13:21:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [February 1, 2023, 1:35pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/2 "2023-02-01T13:35:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dr\_dan](https://www.epiusers.help/user_avatar/www.epiusers.help/dr_dan/32/48005_2.png) [@dr\_dan](https://www.epiusers.help/u/dr_dan)\
**Post date:** [February 1, 2023, 1:35pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/3 "2023-02-01T13:35:54Z")

</div>

I was just thinking about doing this yesterday. Listening…

---

<div class="post-metadata">

**Author:** ![Doug.C](https://www.epiusers.help/user_avatar/www.epiusers.help/doug.c/32/26714_2.png) [@Doug.C](https://www.epiusers.help/u/Doug.C)\
**Post date:** [February 1, 2023, 1:39pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/4 "2023-02-01T13:39:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [February 1, 2023, 2:01pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/5 "2023-02-01T14:01:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Doug.C](https://www.epiusers.help/user_avatar/www.epiusers.help/doug.c/32/26714_2.png) [@Doug.C](https://www.epiusers.help/u/Doug.C)\
**Post date:** [February 1, 2023, 2:06pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/6 "2023-02-01T14:06:44Z")

</div>

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](https://www.epiusers.help/uploads/default/original/3X/e/8/e89e2711285bc00966f15cdb61b5bab3612cc418.png)

If I change it to:

```cs
callContextClient.AssemblyName ?? string.Empty;

```

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

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [February 1, 2023, 2:10pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/7 "2023-02-01T14:10:18Z")

</div>

> [@Doug.C](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Doug.C](https://www.epiusers.help/user_avatar/www.epiusers.help/doug.c/32/26714_2.png) [@Doug.C](https://www.epiusers.help/u/Doug.C)\
**Post date:** [February 1, 2023, 2:12pm UTC](https://www.epiusers.help/t/external-baq-odata-logging/99005/8 "2023-02-01T14:12:33Z")

</div>

Ok, I made an assumption - incorrectly.

I changed it to:

```cs
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](https://www.epiusers.help/uploads/default/original/3X/7/6/76b20e9d911d19471c16bffc9160f6b49da6ad41.png)

EDIT: It’s also NULL for BAQ Reports
