22 July 2020

D365 F&O SSRS Report drillthrough links

Because I always forget the syntax, here is a sample of a drill through link in an SSRS report 

=Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GenerateDrillThroughLink(Parameters!AX_ReportContext.Value, Parameters!AX_UserContext.Value, "TWESalesTableMenuItem", "Display", "TWESalesTable", "SalesId", Fields!SalesId.Value)

If it requires more than one parameter:

=Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GenerateDrillThroughLink(Parameters!AX_ReportContext.Value, Parameters!AX_UserContext.Value, "TWESalesTableMenuItem", "Display", "TWESalesTable", "TWECustGroup", Fields!CustGroup.Value, "TWEOrderStatus", "Open order")


25 June 2020

D365 EventLog error ID1014: The signature is not valid. The data may have been tampered with.


I just found an error message in the event log of an D365 F&O cloud environment that was confusing me. For me the environment was running but I found out that a colleague got the error message: 

Error 500: There is a problem with the server
Sorry, the server has encountered an error. It is either not available or it can't respond at this time. Please contact your system administrator.

This resulted in the error message in the event log. after he switched to another browser it did no longer appear. Clearing the browser cache should also solve this problem.

Microsoft-Dynamics-AX-SystemRuntime
exceptionMessage ID1014: The signature is not valid. The data may have been tampered with.
exceptionSource System.IdentityModel
exceptionStackTrace at System.IdentityModel.RsaSignatureCookieTransform.Decode(Byte[] encoded) at System.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie, Boolean outbound) at System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) at System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(Byte[] token, SecurityTokenResolver tokenResolver) at System.IdentityModel.Services.SessionAuthenticationModule.ReadSessionTokenFromCookie(Byte[] sessionCookie) at System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken& sessionToken) at System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
url /
Method GET
httpStatusCode 500
userGuid {00000000-0000-0000-0000-000000000000}

31 March 2020

Parameter _reportName cannot be null or empty - in D365 F&O

lately we receive the error message "Parameter _reportName cannot be null or empty" when trying to print a report from a journal with view copy or view original. Reprinting using print management is working fine. 
This issue only occurred in our SAT environment in all other environments, Dev, Test and Build it was working as expected.
In older days (AX 2012) I just did a full compile when I got this error. But what to do now? 
After a bit of debugging the result was quite interesting: The print management framework is looking for a report format in the table PrintMgmtReportFormat. The select statement has a where clause which looks for the report and requires the field system to be true. In our DB somehow the reports we were looking for had system flag = no so the _reportName was really empty.
So for everyone who is getting this error message in D365 F&O check the PrintMgmtReportFormat table.


06 February 2020

Get security protocal in D365 x++ code

Sometimes it is interesting to know what security protocol, or which TLS verion is used when it comes to debugging connectivity issues.

This line is used to set the level:

System.Net.ServicePointManager::set_SecurityProtocol(System.Net.SecurityProtocolType::Tls12);

and this piece of code will show you what protocol is enabled

  int secProtocol = System.Net.ServicePointManager::get_SecurityProtocol();
    
  boolean ssl3 = secProtocol == enum2int(System.Net.SecurityProtocolType::Ssl3);
  boolean tls = secProtocol == enum2int(System.Net.SecurityProtocolType::Tls); 
  boolean tls11 = secProtocol == enum2int(System.Net.SecurityProtocolType::Tls11);
  boolean tls12 = secProtocol == enum2int(System.Net.SecurityProtocolType::Tls12);
  boolean tls13 = secProtocol == 12288;
        
  info(strFmt("SSL3 enabled: '%1' | TLS enabled: '%2' | TLS1.1 enabled: '%3' | TLS1.2 enabled: '%4' | TLS1.3 enabled: '%5'", ssl3, tls, tls11, tls12, tls13));



Values:

  • Ssl3 48
    Specifies the Secure Socket Layer (SSL) 3.0 security protocol. SSL 3.0 has been superseded by the Transport Layer Security (TLS) protocol and is provided for backward compatibility only.
  • SystemDefault 0
    Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value.
  • Tls 192
    Specifies the Transport Layer Security (TLS) 1.0 security protocol. The TLS 1.0 protocol is defined in IETF RFC 2246.
  • Tls11 768
    Specifies the Transport Layer Security (TLS) 1.1 security protocol. The TLS 1.1 protocol is defined in IETF RFC 4346. On Windows systems, this value is supported starting with Windows 7.
  • Tls12 3072
    Specifies the Transport Layer Security (TLS) 1.2 security protocol. The TLS 1.2 protocol is defined in IETF RFC 5246. On Windows systems, this value is supported starting with Windows 7.
  • Tls13 12288
    Specifies the TLS 1.3 security protocol. The TLS protocol is defined in IETF RFC 8446.

19 October 2019

DevOps Error: Process 'msbuild.exe' exited with code '1'.

If the build pipeline fails directly after it has startet with the build error: Process 'msbuild.exe' exited with code '1'. This can have multiple reasons. To do the build it requires the AXModulesBuild.proj
So first of all check the folder in the error message. If you are using another folder, different branch,... go to the build pipeline and check the projects path:




Error Message:

Starting: Build the solution
==============================================================================
Task : MSBuild
Description : Build with MSBuild
Version : 1.151.1
Author : Microsoft Corporation
==============================================================================
"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" "C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj" /nologo /nr:false /t:"Clean" /dl:CentralLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=a80b24ca-30a5-4568-b3f7-2c165ff76fec|SolutionDir=C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\DEV"*ForwardingLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:OutputPath="C:\DynamicsSDK\VSOAgent\_work\1\Bin" /p:LogPath="C:\DynamicsSDK\VSOAgent\_work\1\Logs" /p:platform="Any CPU" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_5a5acfcb-fe8b-4039-99f2-cadc61c1646d_build_21_0"
MSBUILD : error MSB1009: Project file does not exist.
Switch: C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj
##[error]Process 'msbuild.exe' exited with code '1'.
"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" "C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj" /nologo /nr:false /dl:CentralLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=d2221e15-48e9-44a2-a294-5c21c60dcaa6|SolutionDir=C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV"*ForwardingLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:OutputPath="C:\DynamicsSDK\VSOAgent\_work\1\Bin" /p:LogPath="C:\DynamicsSDK\VSOAgent\_work\1\Logs" /p:platform="Any CPU" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_5a5acfcb-fe8b-4039-99f2-cadc61c1646d_build_21_0"
MSBUILD : error MSB1009: Project file does not exist.
Switch: C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj
##[error]Process 'msbuild.exe' exited with code '1'.
Finishing: Build the solution

09 October 2019

Unblock multiple files with PowerShell

Because I always forget to unblock files before I extract the zip files from Microsoft: Here is a PowerShell command to do it after the zip is extracted and a whole bunch of files are blocked

dir -Path .\FinanceAndOperations_10.0.136.10007_Application\ -Recurse | Unblock-File

this is definitely faster then deleting all the files and extracting again.

06 March 2019

D365 F&O version 10 - new build features

Great new from Microsoft regarding the build and deployment features in D365 F&O Version 10:

"the build automation framework will not require a VM and will solely rely on Azure DevOps build capabilities."

So we need to no longer manage build environments :)
and the next one is even better. Finally there will be an integration between DevOps and LCS. After uploading hundreds of deployable packages to LCS this might be automated in the future.

"Builds that are release candidates can be automatically deployed to LCS and sandbox cloud environments."

I hope that this will be available soon :)