Sunday, October 12, 2014

Dynamics AX issue ? No problem...

Hi All

In our job, often we have faced some errors or strange behaviors.
Also, often I seen a wrong approach about on figure out the issue.

In many case, the developers try to figure out the issue using debug.
In complex scenarios, the debug approach can take a lot of time and sometime not produce any result.

From my point of view, when we face an issue, the steps are:

1-  Check if there is already a hotfix provided by Microsoft using Lifecycle Services, https://lcs.dynamics.com, especially Issue Search.

2-   Search or post a question on the Microsoft Dynamics AX Community, https://community.dynamics.com/ax/f/33.aspx
      Here you can work with many people that probably have already faced your issue and that can help in the right way to solve.
      Additionally, on MS AX Community you will have the pleasure to work with people that have a lot of seniority on Dynamics AX, both Technical that Functional.

3-   Raise a case on Microsoft, https://mbs2.microsoft.com/support/newstart.aspx
Often, the Microsoft reply is very quick if found the issue in their internal database.
Otherwise, is needed some days just to replicate the case on their environment and provide you the relative hotfix.
Finally, you have the opportunity to help Microsoft to improve Dynamics AX and so have a product more stable for other Customers.

4-  Lastly, before debug, involve your functional colleague just to figure out if the issue can be related to a wrong setup.

Finally, if you have in mind something that could improve the product, submit your suggestions using Microsoft Connect, http://connect.microsoft.com/dynamicssuggestions

Speak soon!


Thursday, September 4, 2014

AX 2012 - Retrieve a Dimension Value from a Index

Hi Guys

Below an useful code for retrieve a Financial Dimension value from an Index :

static DimensionValue DisplayDimensionValueFromIndex( DimensionDefault _DefaultDimension, int _level)
    {
        DimensionValue      ret;
        ;
       
        if( _defaultDimension && _level )
        {
            select RecId, Name
            from LedgerChartOfAccounts
            where LedgerChartOfAccounts.Name == curext()
                join ChartOfAccounts, DimensionHierarchy
                from LedgerChartOfAccountsStructure          
                where LedgerChartOfAccountsStructure.ChartOfAccounts == LedgerChartOfAccounts.RecId
                    join DimensionAttribute, DimensionHierarchy, Level
                    from DimensionHierarchyLevel
                    where DimensionHierarchyLevel.DimensionHierarchy == LedgerChartOfAccountsStructure.DimensionHierarchy
                       && DimensionHierarchyLevel.Level == _level;
   
   
            ret = DimensionAttributeValueSetStorage::find(_DefaultDimension).getDisplayValueByDimensionAttribute(DimensionHierarchyLevel.DimensionAttribute);
        }          
       
        return ret;
    }

Enjoy!

Monday, June 16, 2014

What are the differences between addOrderByField and addSortField

Hi Guys

With addSortField you can set "only" the records order.

With AddOrderByField you can build some logic because is used the kernel class QueryOrderByField.

So, you can use the follow methods :
- direction
- autoHeader
- autoHeaderDetailLevel
- autoSum
- autoSumDetailLevel
- datasource
- fieldId

You can find some examples on the standard class :

- DimensionProvider Class, getDimensionOrderBysFromQuery method
- InventDimCtrl_Frm_OnHand class, modifyQuery method

Enjoy!

Sunday, May 18, 2014

OData Query Service - The exception message is 'Object reference not set to an instance of an object.'.

Hi Technophiles!

The server encountered an error processing the request. The exception message is 'Object reference not set to an instance of an object.'.


If someone have faced this error through browsing the link "http://aoshost:8101/DynamicsAx/Services/ODataQueryService/", the cause could be a query specify on the "Document data sources form" ( Organization Administration > Setup > Document management  ) that doesn't exist anymore.
So, from the form above, delete the queries that no longer exist.

Finally, if you faced problem with the link above, change the AOS server name with the IP address, like http://xxx.xxx.xxx.xxx:8101/DynamicsAx/Services/ODataQueryService/

See you soon!

 

Tuesday, April 8, 2014

Email Parameters - Retrieve SMTP Account Password

Hi All

If you don't know or remember the SMTP Account Password, you can use the code below :

    CryptoBlob  CryptoBlob;
    ;
   
    CryptoBlob = WinapiServer::cryptUnProtectData( (select firstonly SysEmailSMTPPassword).Password );
   
    info ( cryptoblob2str(CryptoBlob) );


That's it! 

Sunday, April 6, 2014

MVP 2014 on Dynamics AX

Greetings!

Few days ago, Microsoft given me the award as MVP on Dynamics AX.
I'm very excited and I do not believe yet.
Thanks to all and I'll continue to work hard to grow on Dynamics AX.

http://mvp.microsoft.com/en-us/mvp/Denis%20Macchinetti-5000776

Stay tuned!

 

Friday, March 14, 2014

How to get Label Id from a text

Hi All

If you want retrieve the Label ID from a specific text description, here the code.
If are present more Label ID for a specific text, you will have the first.

   sysLabelEdit     sysLabelEdit = New sysLabelEdit();
   labelid          labelid;
   str              text = "Customer account";
   str              specialCharsText;
   
   specialCharsText = SysLabel::searchStringBuildSpecialCharString(text);   
   specialCharsText = SysLabel::seachStringBuildExactStr(specialCharsText);
   
   labelid = sysLabelEdit.findLabel("en-us", specialCharsText);
   
   info ( labelid );

That's all!