RE: Wrong Result return RunOnClient = No
Hi Stefano Demiliani,
Here is sample as per your request.
OBJECT Codeunit 50000 DNetTest
{
OBJECT-PROPERTIES
{
Date=12/04/18;
Time=[ 8:32:09 PM];
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnRun=VAR
dnetSysRunOnClient@1000000000 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Principal.WindowsIdentity" RUNONCLIENT;
dnetSysRunOnServer@1000000001 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Principal.WindowsIdentity";
dnetCultureInfoRunOnClient@1000000002 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Globalization.CultureInfo" RUNONCLIENT;
dnetCultureInfoRunOnServer@1000000003 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Globalization.CultureInfo";
BEGIN
MESSAGE('Client User %1\Server User %2',
dnetSysRunOnClient.GetCurrent.Name,dnetSysRunOnServer.GetCurrent.Name);
dnetCultureInfoRunOnClient := dnetCultureInfoRunOnClient.CurrentCulture;
dnetCultureInfoRunOnServer := dnetCultureInfoRunOnServer.CurrentCulture;
MESSAGE('Client Culture %1\Server Culture %2',
dnetCultureInfoRunOnClient.Name,dnetCultureInfoRunOnServer.Name);
END;
}
CODE
{
BEGIN
END.
}
}
You will get right result for Login user name but Culture result is wrong. Why wrong? Culture name is always same, even you set different region setting on server and client. By right should be different name if we set different region setting on Server and Client. "dnetCultureInfoRunOnServer" is running on server but name is taken from "Client Region Name".
In order to test you need to set different Region Setting on Server and Client.