RSS

How To Find Which User Is Locking a Table In Business Central

If you get lots of phone calls that the users can’t do anything because one single user is locking the table you quickly end up in a stressful situation. This entry will be about to how to solve the locking and hopefully find the user that created the lock.

Read the rest of this entry »
 
3 Comments

Posted by on 2024-02-28 in Okategoriserade

 

Tags: , , ,

ChangeCompany Command Is Dangerous

The function Rec.ChangeCompany has been around for quite some in Navision/Dynamics NAV/Business Central. It is quite useful since it allows the user to quickly switch between companies and do record modifications in another companies in the same database. However, this is a very dangerous command especially now when events has been introduced. The question is if this command is still relevant today or if it should be passed to the cemetery.

Read the rest of this entry »
 
Leave a comment

Posted by on 2024-01-18 in Okategoriserade

 

Tags:

How to Find a User From the User Telemetry ID

In my previous log entry I described how to find activity for a specific user in telemetry from Microsoft Business Central. This entry will be about doing the opposite, having a User Telemetry ID and then try to find which user it belongs to. The solution to this varies depending on which Business Central version you are running and which platform.

Read the rest of this entry »
 
Leave a comment

Posted by on 2024-01-08 in Okategoriserade

 

Tags: , , , , , ,

How to search error messages in telemetry from Business Central for a specific user

Sometimes users can’t seem to send proper error message and instead of calling/mailing them back and forth you can always use telemetry to get the error message with the corresponding call stack and other useful info. And if you set up the data proper you can also filter on error messages by user. In fact, it doesn’t need to be error message you can filter on all available telemetry signals that contains the UserId as dimension. This entry will cover that.

Read the rest of this entry »
 
Leave a comment

Posted by on 2024-01-04 in Okategoriserade

 

Tags: , , , ,

Message not shown because the NavBaseException constructor was used without privacy classification

This entry is about on how you can get a more detailed information whey you get “Message not shown because the NavBaseException constructor was used without privacy classification” in the telemetry from Business Central if and only if you are running OnPrem. Spoiler, telemetry errors are shown in the eventviewer.

Read the rest of this entry »
 
Leave a comment

Posted by on 2024-01-03 in Okategoriserade

 

Tags: , , , , ,

How To Show Business Central Server Information In Telemetry

In Business Central it is standard to not show server specific information in telemetry. The reason for this is that many run the SaaS version which makes server information irrelevant since the end users don’t need to care about server information. However, some us still have customers that run OnPrem which this information can be quite useful. One of our customers has multiple servers with job queues activated on all of them. One way of troubleshooting job queues is to look at if a certain server is the source of problem and to do that we need server information in the telemetry.
In this blog entry I will explain how you can create your own telemetry message that send the job queue entry status and server information to application insights.

Read the rest of this entry »
 
Leave a comment

Posted by on 2023-12-21 in Okategoriserade

 

Tags: , , ,

The field with ID = X is not found on the page

This is an error message that I got when I was working with Business Central test pages using BCPT (Business Central Performance Toolkit). This post will explain how to find which field it is and in what page and what reason could be for the error message.

Read the rest of this entry »
 
Leave a comment

Posted by on 2023-12-18 in Okategoriserade

 

Tags: , , ,

AL0000G7I – Multiple custom dimensions with the same dimension name provided.

There is a telemetry event Id called: AL0000G7I – Multiple custom dimensions with the same dimension name provided.

Currently (2023-12-15) this event hasn’t been documented in the offical page for telemetry events.

The reason for the error can seem pretty straightforward. Probably you have added the same dimension twice to the dimension dictionary.

However, this wasn’t the scenario in my case.

There is a function that you can add telemetry dimensions that should be appended to ALL telemetry events (from the current app).

In codeunit 8706 “Telemetry Custom Dimensions”, you can subscribe to the event OnAddCommonCustomDimensions and from that you can append custom dimensions.

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Telemetry Custom Dimensions", OnAddCommonCustomDimensions, '', false, false)]
    local procedure OnAddCommonCustomDimensions(sender: Codeunit "Telemetry Custom Dimensions")
    begin
        sender.AddCommonCustomDimension('ServerInstanceID', format(Database.ServiceInstanceId()));
        sender.AddCommonCustomDimension('ServerInstanceName', GetServerInstanceName());
        sender.AddCommonCustomDimension('ServerName', GetServerName());
    end;

And as you probably you have understood by now it was here that I got the error with the same dimensions. I tried to log send the dimension ServerName multiple times.

And there it is, I hope it solved your error.

 
Leave a comment

Posted by on 2023-12-15 in Okategoriserade

 

Tags: ,

Snapshot debugging against sandbox

This was the first time I was going to debug against a sandbox it it wasn’t as smooth as I thought as it was with OnPrem. The reason for that is that the user id must be the GUID for the user name in BC.

First step is adding a new snapshot configuration for cloud in launch.json

This gives you the following

    {
            "name": "snapshotInitialize: Microsoft production cloud",
            "type": "al",
            "request": "snapshotInitialize",
            "environmentType": "Production",
            "environmentName": "production",
            "breakOnNext": "WebClient",
            "executionContext": "DebugAndProfile"
        },

Now we need to change the environmentType if it is production we would like to debug. We also need to change enviromentName to the same name as the sandbox.

To be on safe side we could add the tenant property which is the id in the url string between dynnamics.com and sandbox name.
https://businesscentral.dynamics.com/<tenantId>/<sandboxName&gt;

If you try go initialize snapshot you should get this (CTRL+Shift + P, AL: Initialize snapshot debugging, or press F7):

[2023-10-12 13:02:58.05] Initializing a snapshot debugging request on debugging context :5041bba9-6353-4cd9-b5d1-24e6168637ef
[2023-10-12 13:02:58.05] Sending request to https://api.businesscentral.dynamics.com/v2.0/<SandboxName>/snapshotdebugger/attach?debuggingcontext=5041bba9-6353-4cd9-b5d1-24e6168637ef
[2023-10-12 13:02:58.53] The snapshot debugger initialize request for the debugging context '5041bba9-6353-4cd9-b5d1-24e6168637ef' has succeeded.
Check the status of an initialized snapshot by using the 'Show all snapshots' command, or by clicking the snapshot debugger icon in the left corner of the toolbar.

First time you may need to create a link between your account and the tenant by authorizing yourself.
REMEMBER! If when you debug it is important that you have downloaded the same symbols that exists in the target machine or the debugging won’t work. So once you have established connection to sandbox. Choose download all symbols

Once you have verified you have connection you can add userID and session id to whom you would like to connect the snapshot debugger to.

 {
            "name": "snapshotInitialize: Microsoft production cloud",
            "type": "al",
            "request": "snapshotInitialize",
            "environmentType": "Sandbox",
            "environmentName": "<SandboxName>",
            "breakOnNext": "WebClient",
            "executionContext": "DebugAndProfile",
            "userId": "<UserGuidInBC>",
            "sessionId": -1
        },

To get the userID when connecting to a sandbox you need to open Users in Business Central and “Zoom” by opening the page inspection for that user record and copy the “User Security ID”.

You get the session id by opening the “Question mark”/Help, choose “Help & Support”, go down to Report a problem and there you will find “Session ID (server)” which has the id to the user you would like to record/snapshot. Copy that to the sessionId in launch.json.

Now launch the initialize snapshot debugger again. The result should be something like this if you have done it right. After that, do the thing and choose finish snapshot when you are done.

[2023-10-12 13:33:45.48] Initializing a snapshot debugging request on debugging context :77d****-****-****-****-**** 
[2023-10-12 13:33:45.48] Sending request to https://api.businesscentral.dynamics.com/v2.0/****/snapshotdebugger/attach?debuggingcontext=****-ac67-****-bcef-****f3c&sessionid=31500&userid=****-****-****-****-****
[2023-10-12 13:33:45.92] The snapshot debugger initialize request for the debugging context '****-****-****-****-****' has succeeded. 
Check the status of an initialized snapshot by using the 'Show all snapshots' command, or by clicking the snapshot debugger icon in the left corner of the toolbar.

If you get something like this it is because you haven’t filled in the Guid for the user.

[2023-10-12 13:40:24.63] Initializing a snapshot debugging request on debugging context :****-****-****-****-****
[2023-10-12 13:40:24.64] Sending request to https://api.businesscentral.dynamics.com/v2.0/****/snapshotdebugger/attach?debuggingcontext=****-****-****-****&sessionid=31500&userid=user%40company.com
[2023-10-12 13:40:26.31] The request for path /v2.0/EQM/snapshotdebugger/attach?debuggingcontext=****-6fbf-****-****-****&sessionid=31500&userid=user%40company.com failed with code BadRequest. Reason: The snapshot debugging session could not be started. The user GUID 'user@company.com' is not valid. 
 
Leave a comment

Posted by on 2023-10-12 in Okategoriserade

 

When does xrec work?

As a Business Central developer we have from time to got used to using xrec and rec as container for previous value and current new value.

However, there are certain scenarios when xrec doesn’t work as intended.

Read the rest of this entry »
 
Leave a comment

Posted by on 2023-05-13 in Okategoriserade

 

Tags: , ,

 
Kauffmann @ Dynamics 365 Business Central

A good programmer makes all the right mistakes.

The BC Docs Librarian

Tips and news for AL programmers

Stefan Maroń

Dynamics 365 Business Central

James Pearson

Thoughts about Dynamics 365 Business Central, Git, Azure DevOps, PowerShell, Automated Testing, Visual Studio Code...and maybe some other stuff

Roberto Stefanetti BLOG

MVP & MCT Microsoft Dynamics 365 Business Central, Powershell, Azure, SQL Server

JoeBrown

DevOps starts with culture!

Comments for DevOps ABCs Blog

Reflections from the ERP field

DevOps ABCs Blog

Reflections from the ERP field

Dynamics 365 Business Central for Partners

Reflections from the ERP field

Freddys blog

Learn something new... - then Teach someone!

Stefano Demiliani Technical Blog

Reflections from the ERP field

David Worthington's NAV Performance Blog

Micosoft Dynamics NAV Performance Testing & Optimization

Freddys Blog

Reflections from the ERP field

Marije Brummel Blog | Business Central, Azure and more...

Design Patterns, Performance, Clean Code

Vjeko.com

Ideas in the cloud

Goprowe AB

Reflections from the ERP field

ArcherPoint

Reflections from the ERP field

The NAV Viking´s Blog

- Sharing my experience in the Dynamics NAV world

Comments for

Reflections from the ERP field