Saturday, December 24, 2011

Error in Management Reporter: "The request for data from Microsoft Dynamics AX failed. Provider query name: LedgerMRBalanceRequestQueryBuilder"

When generating a YTD Balance sheet in Management Reporter (MR) for AX 2012, we were seeing an error being thrown and the report did not run.

The error: “The request for data from Microsoft Dynamics AX failed. Provider query name: LedgerMRBalanceRequestQueryBuilder.”

We checked the appropriate permissions to all folders that MR must access but we were still getting the issue.

The error was isolated to that one specific report as we could run other reports without issue.
The report had a significant amount of data in it and it was causing the query to fail.

Breaking down the report into smaller sections allow the users to run the report without hitting this issue.

This was an MS product issue.  Thankfully, the helpful staff in Fargo was able to resolve it and push out the resolution out in the new AX2012 MR provider Service pack.  Download it from customersource/partnersource to resolve this issue.  The name of the update is
'Microsoft Dynamics AX 2012 Provider for Service Pack 2'
Name of the file you will be downloading:

Hope this helps!!

Tuesday, December 20, 2011

Run static method through X++ code

The following is code that will allow you to run a static method using two strings and a container. You need to assert and revert permissions around doing this but it allows you to dynamically run a static method without knowing what the method is.  This is good for frameworks.
  • _className     = the string name of the AX AOT Class name.
  • _methodName = the string name of the method from the AX AOT Class above.
  • _params           = the container which has the variables, [parameter 1, parameter 2, etc]. 
// Start DAX code
// From parameters:
ClassName _className
MethodName _methodName
Container _params;
// From method variables
Container               result;
DictClass               dictClass;

// This code will run the static method
executePermission = new ExecutePermission();

dictClass = new DictClass(className2Id(_className));
result = dictClass.callStatic(_methodName, _params);

// End DAX code

This code is dynamic and powerful.  Enjoy!

Monday, December 19, 2011

How to get to AOT in AX 2012 (Application object tree)

I was asked this question by someone who was a 3 year seasoned application AX person recently. This person knew enough AX development to be dangerous but was not a developer.  He never claimed to know dev but in talking with him, he knew his stuff.  Which brings me to the question that was asked, "How do you get to the AOT in AX 2012?  It doesn't look like you can anymore".  

I was kind of confused at how the person did not know the answer but then, after talking a bit, realized they would only access the AOT through the AX toolbar. I actually met 2 other people who I know did the same thing.  In AX 2012, the IDE is actually a whole seperate workspace in contrast to previous versions of AX which were all tiled together.  With this new configuration, that button is gone (or moved. I don't know. I never use it...).

Getting to the AOT is as easy as hitting Ctrl+D as long as your user rights permit it.  I could put up screenshots and get into the details but I think everyone who is involved in AX knows that the easiest way is the best way. Just hit Ctrl+D when you are in your AX instance and, BLAMMO!, a new instance/workspace of AX with the AOT will appear to you like a magic genie in a bottle. 

Easier and faster than ordering room service...  Enjoy!

AX 2012 WCF Error: 'The specified client configuration does not contain valid WCF settings'

I hit the following error while working in AX 2012: 'The specified client configuration does not contain valid WCF settings' (Figure 1 below).  This seemed to happen all over the place when specfic actions were done. Didn't care or have enough time to pin point what.  The actions were pretty varied and seemed almost random.  Try running the On Hand Inventory report...

This error was only encountered in AX 2012.  It is because of an issue with a new feature in the AX configuration file that needs to be fixed through the configuration utility.  Do the following to fix the issue:
  1. Open the .axc where this issue was being seen in the Microsoft Dynamics AX Configuration Utility.
  2. Click on the 'Connection' tab
  3. Click on the 'Refresh' button and wait for the proces to complete.
  4. Click on the 'Configure Services' button'
  5. You will now see the info message in Figure 2. Click 'Ok'
  6. You will now see the info message in Figure 3. Click 'Yes'
  7. You will now see the info message in Figure 4. Wait for the process to finish.
  8. You will now see the info message in Figure 5. Click 'Ok'
  9. A new window for Microsoft Service Configuration Editor will appear (Figure 6 below).  You can close this screen.
  10. Save this configuration
  11. Open the config file and verify there is an XML section of the file (Figure 7 below).
  12. Replace the config file in all the user's desktop with the new one.
Figure 1 - The error at hand...
Figure 2 - Clicking 'Configure Services' will give this information. Click 'Ok'

Figure 3 - Clicking 'Ok' in Figure 2 gives this message. Click 'Yes'
Figure 4 - Clicking 'Yes' in Figure 3 will show this process window.  Wait for it to finish
Figure 5 - Once Figure 4's process is complete, this information is presented. Click 'Ok'
Figure 6 - This pops up at the end of the process.  Just close out of it.
Figure 7 - This is what opening the new .axc file looks like after running that process.