Wednesday, March 12, 2014

SQL Error: String or Binary data would be truncated

Issue: SQL error during Insertion of records to a custom table
"String or Binary data would be truncated" and the SQL insert command is shown in the error infolog.

Description:
The issue will occur only if you have modified the field column length of a table after the records are created in Dynamics AX. When you are trying to insert the records, even though your data is within the column length, the existing rows might be inconsistent with the new data inserted. No synchronization errors are shown but the error will be only upon insert.

Resolution:
Delete the affected column and recreate the column with the correct length, impact existing data might be lost. Make sure to evaluate the issue's pro's and con's before actually deleting the columns and as a Golden rule always always backup the Database/Table before any columns are deleted. You don't want to have nasty surprises or abnormal behaviors after the deletion.


SSRS Reports Performance boost!

We always not matter how the code is optimized there is always a complaint from the user that the reports are slow from their perspective, especially if they run the reports the first time. The performance is much better though when the report is re-run again, as we say it the SSRS has warmed up to service the report requests. So it is exactly what has been incorporated in the 2012 R2 CU7 and above, there is a new report "warm up" class called the SSRSReportServerWarmup.
The warm up class will connect and load the AX assemblies to reporting server cache which cuts up a lot of time when the users will actually run the report. However you would still need to run this class as a batch job after the Reporting server restart to get the performance gain.
The best thing about the class is it is extendable and you would be able to even run up specific reports to further the performance improvements in loading and caching the assemblies before the user actually runs the report. Please do read up on the extensibility and SSRSReportServerWarmup class at the TechNet and the AX support site

Do incorporate and demonstrate to the client on the performance gains made in the SSRS report loading if they have any complaints!

Wednesday, February 19, 2014

WinAPI::ShellExecute() for a JAR file for Banking application

Recently came across a scenario where a banking a hash program needs to be called to encrypt a payment file before sending to the Bank. The bank had just changed the hashing program from an .exe file to a .cmd, this file inturn was a batch script file which would validate and then call a JAR file with the appropriate parameters.
Issue:- While executing the .cmd file from the Command prompt the JAR file runs and hashes the file correctly, but when we use the Dynamics AX to call the .cmd file the JAR file is not executed. The command used was WINAPI::ShellExecute(Command, Parameters);

Investigation :- After preliminary checking from both the AX and command prompt we guessed that the .cmd file was not being executed due to a failure in the calling mechanism. We tried different approaches by calling the cmd.exe and then pass the parameters to mimick the manual approach. But somehow the command prompt opened up but did not execute the JAR file. Then next approach was to add all the commands inside a batch script file which would call the JAR file, so from AX we wouldn't need to specify the details in AX but would just call the batch script file. Still the execution of JAR file from AX was not happening even though we could execute the file manually.
After a lots of Google searches on the execution environment with ample trial and error my colleague identified that the issue was due to JRE execution is the root cause. Meaning that Dynamics AX looks for the Java Runtime under the 32 bit folder(under C:\Program Files (x86)\Java\bin) instead of the 64 bit installed in Windows server 2012 machine. This could be because of the legacy run time approach followed since the older versions executing the JAR files.

Conclusion:-
Install the 32 bit Java runtime on the server.

Notes:
AX job would look something like this to call the WINAPI::ShellExecute(command); where the command = @D:\TestScript.bat

And test script  batch file will have,
CD D:\HashFile\
D:\HashFile\HashProgram.cmd parm1 parm2 parm3 parmx....
Another thing to note is to link the batch file to the folder using CD D:\HashFile\ before executing the .cmd file. To point to the correct execution folder before running the command.


Add on:- For those who are trying to execute exe as a process from X++, do find an excellent post from Bo Jensen at his blog post - X++ run a process with user credentials



Thursday, February 13, 2014

Publish-AXReport : SSRS Deployment Error 'Domain/User' is not recognized

I faced this issue during deployment of all the default SSRS report when I was migrating the application from Development environment to UAT. The issue occurs due the previous AOS sessions that are present in the Table SysServerSessions table. This table will not be listed in the AOT and you will be able to access this table for viewing the records from SQL management studio, alternatively you can also create a dummy form and access the table from datasource.

There is no problem in deleting the records in this table as the records are automatically inserted by the AOS when AOS service starts up. 

Conclusion:- Turn off the AOS and clear the records from SysServerSessions table. Republish the SSRS reports it'll publish correctly.


Wednesday, February 12, 2014

Report Deployment Error - Value cannot be null. Parameter name : explicitConfiguration

Today faced an SSRS error when deploying on of the reports in our client environment on AX 2012 R2 CU6

The error is exactly similiar to the issue described in this blog. Please refer for the error event log and the detailed description about the WCF service artifacts failure.

Conclusion: Fix the endpoint or deactivate the failed service group and re-try the report deployment again.


Dynamics AX 2012 R3 Training Blitz

Dynamics AX 2012 R3 is just around the corner, and is planned for GA by May 2014.

There some initiatives from the Microsoft Product team for familiarizing the product before GA. Some of the avenues are Technical & Product Conferences and Microsoft Connect for CTP. Recently there are some very public R3 Training Blitz webcasts for showcasing what can be expected in the new release. The webcasts are free and can be joined by everyone, during the conference the team diligently answers the questions from the viewers. Also the first webcast for the R3 is recorded and out on the Youtube which is a great way to reach out to all those who would have missed it.

The second sessions are planned for Feb 26 and Feb 27, please do join in as it has specific segments for the verticals including Retail & Manufacturing. I am very interested and keen to know the new things that are being implemented in the R3 Retail after seeing some of the significant changes in the CTP sessions.
Here is the link for you to join the Dynamics AX virtual events, do signup and enjoy the sessions.

Just incase if you have missed the Part 1 of the Traning blitz webcast, catch it on Youtube here.


Wednesday, November 6, 2013

Release of AX 2012 R2 CU7 and upcoming release of AX 2012 R3 on Cloud


AX 2012 R2 CU7

The release of CU7 for R2(KB2885603 - 6.2.1000.4051) signifies a lots of fixes, feature additions and updated user experience of the core modules. Please find below link from the Microsoft community for the detailed changes in each of the modules.

AX 2012 R3 released in April 2014

A good MSDN article on what we can expect on the upcoming new functionalities on both the verticals and core modules. Most importantly the AX 2012 R3 can also be hosted on the cloud using Windows Azure services. This means that the Dynamics AX can be hosted at a remote site and customers can access the services as a subscription.
The folks attending the Technical conference in February will seem to have hands on access to R3, that would be really interesting to hear about their thoughts.
Here is the MSDN community link where the new features are briefly described.
The tag line of AX 2012 R3 seems to be
1. Engage Customer on their own terms
2. Satisfy changing customer needs
3. Serve your customers better and expand your business