![]() |
#1 |
Участник
|
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, напишите личное сообщение администратору. |
|
|
|