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 »Tag Archives: Business Central
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 »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.
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 »Tag: 0000G92 – Sales Header must not be temporary
Are you running OnPrem and you get a lot of warnings “Tag: 0000G92 – Sales Header must not be temporary” or “Tag: 0000G95 – Sales Header must not be temporary” in the event viewer like this?
Read the rest of this entry »Business Central: Multiversion Branch With Preprocessor Directives
Like many companies nowadays we have bunch of customers with different Business Central versions that we need to support.
On top of this many of us tries to “create money while we sleep” by creating stand alone apps that we could reuse/resell to new customers and perhaps eventually put them on AppSource in the next step.
This means that we need to support/maintain our standalone apps in multiple versions.
Read the rest of this entry »