AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.12.2011, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
sumitsaxfactor: Getting Individual Dimension Combination Values–Dimension Storage class [AX 2012]
Источник: http://sumitsaxfactor.wordpress.com/...class-ax-2012/
==============

In this post, I will be explaining the method to get individual values for each dimension combination that is created and stored.

Dimension combinations are stored are DimensionAttributeValueCombination class. But they are stored as a combination ex: (100010-AX-00001- – - -). How would you know the value in each combination belongs to what dimension?

The answer is through dimension storage class. This class is used to manipulate these combinations.

The job below helps you in finding out the required values. The job has lots of self explanatory comments.



staticvoid getDimensionCombinationValues(Args _args)

{

    // DimensionAttributeValueCombination stores the combinations of dimension values

    // Any tables that uses dimension  combinations for main account and dimensions

    // Has a reference to this table’s recid

    DimensionAttributeValueCombination  dimAttrValueComb;

    //GeneralJournalAccountEntry is one such tables that refrences DimensionAttributeValueCombination

    GeneralJournalAccountEntry          gjAccEntry;

    // Class Dimension storage is used to store and manipulate the values of combination

    DimensionStorage        dimensionStorage;

    // Class DimensionStorageSegment will get specfic segments based on hierarchies

    DimensionStorageSegment segment;

    int                     segmentCount, segmentIndex;

    int                     hierarchyCount, hierarchyIndex;

    str                     segmentName, segmentDescription;

    SysDim                  segmentValue;

    ;

 

    //Get one record for demo purpose

    gjAccEntry = GeneralJournalAccountEntry::find(5637765403);

 

    setPrefix("Dimension values fetching");

    //Fetch the Value combination record

    dimAttrValueComb = DimensionAttributeValueCombination::find(gjAccEntry.LedgerDimension);

    setPrefix("Breakup for " + dimAttrValueComb.DisplayValue);

 

    // Get dimension storage

    dimensionStorage = DimensionStorage::findById(gjAccEntry.LedgerDimension);

    if (dimensionStorage == null)

    {

        throw error("@SYS83964");

    }

 

    // Get hierarchy count

    hierarchyCount = dimensionStorage.hierarchyCount();

    //Loop through hierarchies to get individual segments


<span><font face="Consolas"><font size="2">    for(hierarchyIndex = 1<font color="#000000">; hierarchyIndex
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
sumitsaxfactor: Dimension Provider Class and Run-time dimension ranges [AX 2012] Blog bot DAX Blogs 1 28.08.2013 12:42
daxline: Set financial dimension values through code in AX 2012 Blog bot DAX Blogs 0 18.11.2011 02:26
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:28.