Search This Blog

Monday, February 24, 2014

AX2012 Get dimension Values


To get the master Data for Dimension attributes we can use two service classes.
1. DimensionService
2. DimenisionValueService

we will see what Dimension Service class is providing
1. getActiveDimensionsFromLedger()- Gets active dimensions in current company which will return the DimensionContract class collection List.
2. getDimensions(AccountStructureContract _accountStructureContract)-Processes an incoming account structure contract and return a list of financial dimensions for a specific account structure.
3. getDimensionsAll()-Gets a list of all financial dimensions, which returns a A String list of dimension values using DimensionContract class.

we will see what DimensionValue Service class is providing
using this class we can create/Get DimensionValues for the specific dimension attribute.

Methods:
1. createDimensionValue(DimensionValueContract _dimensionValueContract)-Processes an incoming dimension value contract and creates a financial dimension value for a specific financial dimension.
2. getDimensionValues(DimensionContract _dimensionContract)- processes an incoming dimension contract and returns a list of financial dimension values for a specific financial dimension. and returns the list of the dimension values for that specific dimension attribute.

we can use this service classes and consume in any external application and call this service methods.


by using these two services we can get the dimension values easily.


static void Krishh_getDimensionValues(Args _args)
{

    List                            dimensionAttributeList;
    ListEnumerator                  listEnumerator;

    DimensionService                dimensionService;
    DimensionContract               dimensionContract;
    AccountStructureContract        accountStructureContract;

   
    dimensionService            = new dimensionService();

    accountStructureContract    = new AccountStructureContract();
    accountStructureContract.parmName("Account Structure - P&L");

    dimensionAttributeList      = dimensionService.getDimensions(accountStructureContract);

    listEnumerator  = dimensionAttributeList.getEnumerator();
    while (listEnumerator.moveNext())
    {
        dimensionContract   = listEnumerator.current();
        info(strFmt("%1, %2",dimensionAttributeList.elements(), dimensionContract.parmDimensionName()));
    }

}

2 comments:


  1. hello,
    I'm very much new to "microsoft dynamics AX".I recently got a job in "ogilvy and mather" to work on it.I'll be given training on it for 6 months then i'll be doing my actual job.Is it good to start my IT career with "Microsoft Dynamics AX"? I'm a b.tech 2014 passout...

    ReplyDelete
    Replies
    1. Hi Nikiktha,
      You got an fantastic oppurtunity to start your career in Dynamics AX, it will give you the KickStart to your career growth.I wish you all the best.
      if you have any questions you can ping me on my skype.
      krishna.

      Delete

Thanks for visiting my blog,
I will reply for your comment within 48 hours.

Thanks,
krishna.