Skip to main content

Posts

Showing posts from February, 2013

Project as an Offset account type disabled on journals [AX 2012 R2]

You might or might not have noticed in AX2012 R2, the use of projects as an offset account type has been blocked. If you try and select it you get a message like this. This was intentionally done by Microsoft to avoid further critical issues. Specially certain scenarios causing ledger in balance. Now, you have to remember there are alternatives to this. You can still use it as the main account and then use something else as the offset account. Otherwise, do it as two lines journal. [No screenshot]

Product attributes and beyond [AX 2012]

Product attributes is a great piece of functionality that was introduced in AX 2012. It allows you to set up and capture additional information against a product. I recently have taken it one step further to make it more visible and user friendly. At the moment it is hidden away on a form you have to open. In a similar fashion to the way financial dimensions work, where the controls dynamically show up on a fast tab. The attribute controls do the same. Here is a quick screenshot to show how powerful it can be. I got the field groups to work by using attribute groups (which is part of retail key). If you are looking for some info on product attributes have look at these links. http://technet.microsoft.com/en-us/library/hh227548.aspx http://www.slideshare.net/murrayfife/using-product-attributes-to-record-nutritional-information-part-1 http://dynamicscare.com/blog/product-attributes-in-ax-2012 This is one of many pieces of frameworks that AX 2012 provides. Its up to us to make

str2Num doesn’t work as expected

If you are trying to convert a string to a decimal, you might notice that it doesn’t always work. It is very sensitive on the formatting of the string. Input Output (str2Num) Output (str2NumOk) System.Convert::ToDecimal(strValue); 1 23 1 false catch the exception as nothing is resolved 1abc 1 false catch the exception as nothing is resolved 1,123.00 1 false 123.00         You can use the method str2NumOk() to check Alternatively, you could use the .NET system method to convert the string to a decimal. This handles conversions a little better. real   decimalValue = System.Convert::ToDecimal(strValue); Sample job code to test it out the third example. static void testStringToNumeric ( Ar gs _args ) { str strValue ; real realValue ;    strValue = "1,123.00" ; print str2num ( strValue ) ; //returns 1 print str2NumOk ( strValue ) ; //returns false try { realValue = System . Convert :: ToDecimal (

Delete Private AOT projects in AX 2012

This is a common problem since the old days. People leave projects in their private project and no one can get to it to clean it up. In pre AX2012, it was a matter of selecting the utilElements and calling the AOTDelete method. I won’t go through it here. In AX2012, it is all maintained in the model store. Let see it in pictures. Below are the projects you want to delete. You can see them in the SysModelElement table. It is in the system tables section. I wrote a job to loop through and delete them. I had to Code: static void deleteAllProjectObjects3( Args _args) { /* msdn.microsoft.com/en-us/library/bb190038(v=ax.10).aspx */ SysModelElement sysModelElement; ProjectNode privatePn; ProjectNode pn; utilElementName shortName; int len; str preFix; // Navigate to the Private projects folder. privatePn = infolog.projectRootNode().AOTfindChild( "Private" );

TFS Synchronization on a different domain [AX 2012]

This was an issue we faced recently. We had some new developers that were on a different domain. We manage to get it all to work by setting up a VPN. Then we had issues with TFS syncing. The answer here is to Follow these steps Go to internet explorer, Navigate to your tfs site. eg. http://tfs.mycompany.com:8080/tfs/ Then log in with your user name and password. Leave this browser in the background. Don’t close it. Go to AX and start syncing. Note: You will have to give permissions for folder access.

SRS report does not reflect the new query changes – cache issue [AX 2012]

In some scenarios you may see that your query changes doe not reflect in the report. This is due to some caching that is done. The obvious thing is to delete the AUC files and clear out your data usage. But there is a new table that we need to be aware of in this scenario. Navigate to the AOT and delete the SRSReportQuery table. In table browser, you can only delete records that have the same user id (Note: you can only delete your records. You can not delete other users.). The reason you don’t have permission is because the delete method was overridden to restrict this. Below I wrote a job to delete them all with out hitting the delete trigger. Code: static void deleteSRSReportQuery( Args _args) { SRSReportQuery srsReportQuery;     ttsBegin; while select forUpdate srsReportQuery     {        srsReportQuery.doDelete();     }     ttsCommit; } See the troubleshooting article on technet which briefly mentions this. http://technet.microsoft.com/en-us/library/gg731