web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

how to get the detailed description of the display value in dimension attribute value combination table

(0) ShareShare
ReportReport
Posted on by 1,737

all the ledger dimensions are stored in the dimension attribute value combination table in ax

suppose in dimension attribute value combination one field is there display value 

in this field some times main accounts and some times combination of main account and business unit and department are stored.

if only main account is there we can get the main account name easily make a relation with the main account table.

suppose the value is like this.

2221100-00000021-00000101-00000027

(mainaccount) - (business unit)-(department)-(worker).

how to get the detailed information like.

(Equity and liabilities) - (mumbai)-(purchase Department) - (srinvas).

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    You can use DimensionStorage class. Like this:

    DimensionStorage dimStorage = DimensionStorage::findById(ledgerDimension);
    DimensionStorageSegment segment;
    int i;
        
    for (i = 1; i <= dimStorage.segmentCount(); i++)
    {
        segment = dimStorage.getSegment(i);
        info(DimensionAttributeValue::find(segment.parmDimensionAttributeValueId()).getName());        
    }
  • srinivas pamidi Profile Picture
    1,737 on at

    Hi Martin,

    Please find the below code i am writing in the Budget tmp balance table insert method.

    for getting the Description of the Dimension Values

    select generalJournalAccountEntry

       where generalJournalAccountEntry.LedgerAccount == this.DimensionFocus;

           //Fetch the Value combination record

       dimensionAttributeValueCombination = DimensionAttributeValueCombination::find(generalJournalAccountEntry.LedgerDimension);

       // Get dimension storage

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

       if (dimensionStorage == null)

       {

           throw error("@SYS83964");

       }

       // Get hierarchy count

       hierarchyCount = dimensionStorage.hierarchyCount();

       //Loop through hierarchies to get individual segments

       for(hierarchyIndex = 1; hierarchyIndex <= hierarchyCount; hierarchyIndex++)

       {

           //Get segment count for hierarchy

           segmentCount = dimensionStorage.segmentCountForHierarchy(hierarchyIndex);

           //Loop through segments and display required values

           for (segmentIndex = 1; segmentIndex <= segmentCount; segmentIndex++)

           {

               // Get segment

               segment = dimensionStorage.getSegmentForHierarchy(hierarchyIndex, segmentIndex);

               // Get the segment information

               if (segment.parmDimensionAttributeValueId() != 0)

               {

                   // Get segment name

                   segmentName = DimensionAttribute::find(DimensionAttributeValue::find(segment.parmDimensionAttributeValueId()).DimensionAttribute).Name;

                   //Get segment value (id of the dimension)

                   segmentValue        = segment.parmDisplayValue();

                   //Get segment value name (Description for dimension)

                   if(segmentName == 'MainAccount')

                   {

                   MainAccountDescription  = segment.getName();

                   }

                   if(segmentName == 'BusinessUnit')

                   {

                   BusinessUnitDescription  = segment.getName();

                   }

                   if(segmentName == 'Zone')

                   {

                   ZoneDescription  = segment.getName();

                   }

                   if(segmentName == 'Department')

                   {

                   DepartmentDescription  = segment.getName();

                   }

              this.SG_Name = MainAccountDescription + ' -' + BusinessUnitDescription + ' -' + ZoneDescription + ' -' + DepartmentDescription;

               }

           }

       }

    But i am unable to find out the relation between the General Journal Account Entry and Budget tmp balance.

    I am just wondering why this select query is not working.

    I am Just Finding in another way like take the ledger dimension from the ledger account and get the description.

  • Verified answer
    Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    That's a completely different topic, so it doesn't belong here. Furthermore, you already have a thread about it, so keep it there.

    The topic of this thread is "how to get the detailed description of the display value in dimension attribute value combination table".  If my reply answered this question, please mark it as such ("Did this answer your question?" > "Yes"). If it didn't, please explain what else do you need to know before this thread can be closed.

    But don't change the topic. It thread titles had nothing with what's discussed in them, the forum would be unusable.

  • Shyam Mani Profile Picture
    331 on at

    But one addition, to use change company('Required company') as this code always considers current company (entity instance). If a ledgerdimension of another company is being checked in current company, then it will show blank value, because it gets name for the current entity instance only.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans