Telemetry in Action 🧐: Track User Activities in BC 🔍

Tenemos algunas funcionalidades que nos permiten identificar operaciones diarias de los usuarios dentro de Business Central, como lo son:

Adicionalmente, tenemos la posibilidad de apoyarnos en la telemetría, ya que, existen algunos eventos que nos permiten seguir los movimientos de los usuarios en Business Central, como los siguientes:

Las siguientes sentencias nos ayudarán a obtener las actividades realizadas por un usuario (user_ID), en una empresa determinada (companyName) y en una fecha y rango de horas determinadas (timestamp).

traces
| where datetime_utc_to_local(timestamp, 'Europe/Madrid') between(datetime('2025-03-24T00:00:00.000')..datetime('2025-03-28T23:59:00.000'))
| where customDimensions.eventId in ('CL0003','RT0002','RT0004','RT0003','RT0006','RT0007','RT0011','AL0000CTE','AL0000DD3','AL0000EMW')
| where user_Id == 'userguid'
| where customDimensions.clientType == 'WebClient'
| where customDimensions.companyName == 'company'
| project
    timestamp
    ,message
    ,customDimensions.eventId
    ,customDimensions.alObjectId
    ,customDimensions.alObjectName
    ,customDimensions.companyName
    ,customDimensions.clientType
    ,user_Id    
    ,customDimensions
| order by timestamp
pageViews
| where datetime_utc_to_local(timestamp, 'Europe/Madrid') between(datetime('2025-03-24T00:00:00.000')..datetime('2025-03-28T23:59:00.000'))
| where customDimensions.eventId == 'CL0001'
| where user_Id == 'userguid'
| project
    timestamp
    ,name
    ,customDimensions.eventId
    ,customDimensions.alObjectId
    ,customDimensions.alObjectName
    ,customDimensions.hostType
    ,customDimensions.clientType
    ,user_Id    
    ,customDimensions
| order by timestamp

Adicionalmente, a los eventos de telemetría mencionados anteriormente, no nos olvidemos de los eventos de telemetría personalizados, los cuales usamos en nuestras extensiones. Es decir, podríamos crear eventos de telemetría para que identifiquemos lo que hace un usuario en nuestra solución.

traces 
| where datetime_utc_to_local(timestamp, 'Europe/Madrid') between(datetime('2025-03-24T00:00:00.000')..datetime('2025-03-28T23:59:00.000'))
| where user_Id == 'userguid'
| where customDimensions.eventId contains "GDRGDev_CustomTelemetry"
| order by timestamp

De todas maneras, extraño algunos eventos de telemetría adicionales que complementarían positivamente la traza de las operaciones de un usuario dentro de Business Central, estos son:

  • Nuevos eventos relacionados con el seguimiento de la ejecución de las consultas (como los eventos de generación de informes RT0006, RT0007, RT0011).
  • Nuevo evento relacionado con el cierre de la página.
  • Nuevo evento o reutilizar el evento CL0003 para rastrear la ejecución de las acciones de la página. Es decir, por ejemplo, cuando un usuario presiona un botón.

Es por eso, que he agregado esta idea en el portal de Ideas de Dynamics 365, si te parece interesante te invito a votar por el mismo.

Espero que esta información te ayude.


We have some features that allow us to identify the daily operations of users within Business Central, such as:

Additionally, we have the ability to rely on telemetry, as there are certain events that allow us to track user activities in Business Central, such as the following:

The following queries will help us obtain the activities performed by a user (user_ID) within a specific company (companyName) and during a given date and time range (timestamp).

traces
| where datetime_utc_to_local(timestamp, 'Europe/Madrid') between(datetime('2025-03-24T00:00:00.000')..datetime('2025-03-28T23:59:00.000'))
| where customDimensions.eventId in ('CL0003','RT0002','RT0004','RT0003','RT0006','RT0007','RT0011','AL0000CTE','AL0000DD3','AL0000EMW')
| where user_Id == 'userguid'
| where customDimensions.clientType == 'WebClient'
| where customDimensions.companyName == 'company'
| project
    timestamp
    ,message
    ,customDimensions.eventId
    ,customDimensions.alObjectId
    ,customDimensions.alObjectName
    ,customDimensions.companyName
    ,customDimensions.clientType
    ,user_Id    
    ,customDimensions
| order by timestamp
pageViews
| where datetime_utc_to_local(timestamp, 'Europe/Madrid') between(datetime('2025-03-24T00:00:00.000')..datetime('2025-03-28T23:59:00.000'))
| where customDimensions.eventId == 'CL0001'
| where user_Id == 'userguid'
| project
    timestamp
    ,name
    ,customDimensions.eventId
    ,customDimensions.alObjectId
    ,customDimensions.alObjectName
    ,customDimensions.hostType
    ,customDimensions.clientType
    ,user_Id    
    ,customDimensions
| order by timestamp

Additionally, beyond the previously mentioned telemetry events, let’s not forget about custom telemetry events, which we use in our extensions. This means we could create telemetry events to identify what a user is doing within our solution.

traces 
| where datetime_utc_to_local(timestamp, 'Europe/Madrid') between(datetime('2025-03-24T00:00:00.000')..datetime('2025-03-28T23:59:00.000'))
| where user_Id == 'userguid'
| where customDimensions.eventId contains "GDRGDev_CustomTelemetry"
| order by timestamp

In any case, I miss some additional telemetry events that would positively complement the trace of a user’s activities within Business Central. These are:

  • A new event or reuse event CL0003 to track the execution of page actions—for example, when a user presses a button.
  • New events related to tracking query execution (such as report generation events RT0006, RT0007, RT0011).
  • A new event related to page closing.

That is why I have added this idea to the Dynamics 365 Ideas portal. If you find it interesting, I invite you to vote for it.

I hope this information helps you.


Más información / More information:

Deja un comentario