Skip to main content

Posts

Import custom dimensions job [AX 2012]

This is a job I had in my kitty. Thought I just blog it before I lose it. It imports custom dimensions. I had to write one up Code: static void naxax_importCustomDimensions( Args _args) { //dialog AsciiIO asciiIO; Filename filename; NoYesId skipFirstLine; Container line; Dialog dialog; DialogField dialogFileName, dialogSkipFirstLine, dialogCountryRegionId; //values DimensionFinancialTag dimensionFinancialTag; DimensionAttribute dimensionAttribute; DimensionAttributeValue dimensionAttributeValue; RefRecId categoryRecid; Name name; DimensionValue dimValue; Description description; dialog = new Dialog ( "Import custom dimension values" ); dialogFileName ...

Workflow hierarchy assignment common errors explained and tester job [AX 2012]

Workflow hierarchy assignment has a lot of interdependent data that must be set up. If one of those is missing or is incorrect – the processor will just error out. Sometimes with very little information or confusing errors. Below is an example of an error that is not very well written. It doesn’t tell you which record failed. Someone went into the effort of creating the labels correctly but did not use it properly. Here are some common errors you would get while processing the workflow. “The hierarchy provider did not return any users.” – Next Position was not found. “Worker not found for position ID %1.” – No worker is attached to a position. Go to the worker and make sure they have a primary position. If no primary position exists, then the system will find the oldest position (one with the earliest start date). Also make sure the worker is an employee of the company to submit the workflow. “User not found” – User not found for the worker. Check the user relations. “User...

“Error in getting SID” when running Named user license count report [AX 2012]

Recently I tried running the Named user license count report and got this error. “Error in getting SID” From the error I know what the problem is. One of the users can not be found in Active directory. I wrote a quick job to find me the invalid users. static void navax_findBadUserNames ( Args _args ) { UserInfo userInfo ; container con ; ;    while select forUpdate userInfo where userInfo . Enable && userInfo . AccountType != UserAccountType :: ADGroup { con = SysUserLicenseMiner :: getUserRoles ( [ userInfo . Id , userInfo . company ] ) ; if ( conLen ( con ) == 0 ) { warning ( strFmt ( "Userid: %1, username: %2" , UserInfo . networkAlias , UserInfo . name ) ) ; } } } You will get something like this in the infolog.

TFS labels with multiple models [AX 2012]

For sometime I have been working on a project which uses multiple models. TFS doesn’t support multiple models and one of the issues is labels. It only works with a single label file from the system settings. My project was building a new module in AX with its own label file. This way we don’t have a dependency on the the existing implementation. We decided to keep it simple by modifying the class that returns the default label id when objects are checked in. By making the small change below – It will return a specific label id (ABC) when you are in the particular model (MyModel).

Stop workflow submitter from approving [AX 2012 R3 CU8]

This is a common request in previous versions of AX. Usually you would want to stop the submitter from approving their own workflow. Dynamics AX 2012 CU8 has introduced a new flat on the Workflow parameters. “Disallow approval by submitter”. This is a global setting and not workflow specific. To test this out I created a user group with 2 users. One of them being my account. I created a workflow for journals and used Role based assignment to the APTeam user group.   I was allowed to submit it but I found the workflow history had an error. ie Submitter cannot be the approver. I understand why Microsoft has done it this way but I am not a big fan of it. I don’t like introducing errors in the workflow history. It makes the workflow configuration very difficult. Lets say you had a team of 5 users. Each one was able to submit but not approve their own journals. Then you would have to create a complex workflow configuration to deal with all the combination. I have done similar...

Bringing copy company back [AX 2012]

Back in 2013 I wrote a blog post on how to duplicate a company. I basically summarised Microsoft's guide on MSDN. http://dynamicsnavax.blogspot.com.au/2013/07/duplicate-company-in-ax-2012.html The big issue with those steps are that it is very manual and can scare a lot of people. Imagine having to copy a company set up for 10 plus companies. This can be very tedious and time consuming. Plus there are some references that have to be set up manually like the journal names voucher series. So, why not automate. I have put my project on codeplex which you can download and use (READ here carefully). User guide Download the class from https://dax2012copycompany.codeplex.com/ under source codes tab Import it into your AOT Run the class NAVAX_CopyCompany – Right click Open. From company – Enter the from company id To company – Enter the new company id (if company doesn’t exit it will create it) Use record ID compression – RecIds are recreated and in sequence Release produc...

Dynamics AX 2012 Cumulative update 8 Install Explained

With the recent release of AX 2012 cumulative update 8 there has been some considerable changes to the installation. I will try explain a few of the major ones to consider. Before anything you must read the blog post from Microsoft: http://blogs.technet.com/b/dynamicsaxse/archive/2014/11/24/ax-2012-r3-cumulative-update-8-faq.aspx Download is available on LCS now. We are given 2 choices a slipstream and an update installer. When you run the update installer it will download actual installation files (application models/binary) at the time of installation and you are able to save it the end of the process. Below are screenshot of the About form. Notice the version number difference. Read the blog link for detail – it explains both versions.     Slipstream Update Installer     Below are screenshots of the models installed form. Notice how a slipstream (ie. New installation) contains a single SYP model. On the second screenshot notice how it has ins...