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 "Allow blank" value for an account structure's dimension attributes through code?

(0) ShareShare
ReportReport
Posted on by 30

Hello everyone.

How do I get DimensionConstraintNode.isOptional value through code for each dimension attribute, if the only thing I have is MainAccountId?

I found out, that from MainAccountId I can get MainAccount record, then account structure as DimensionHierarchyId and then DimensionConstraintTree record.

Using DimensionHierarchyLevel I can get iterate through structure's attributes. But can't figure out, how do I relate DimensionConstraintNode.Ordinal and MainAccountId?

The image of both DimensionConfigureAccountStructure form and DimensionConstraintNode is provided bellow. These are the objects that I investigate. Form and table shown data is related.

pastedimage1561986431436v1.png

*This post is locked for comments

  • Verified answer
    AlexanderZh Profile Picture
    AlexanderZh 30 on at
    RE: How to get "Allow blank" value for an account structure's dimension attributes through code?

    I accidentally found the solution.

    There is a method in DimensionHierarchy table DimensionHierarchyId getAccountStructure(RecId _mainAccountRecId, LedgerRecId _ledgerRecId = Ledger::current()).

    You can notice, that sql statement, that used in this method, targets Main Account DimensionConstraintNode, that is related to given MainAccountId. So to get DimensionConstraintNode record, I copied this method, removed all caching parts, replaces exists join to simple joins and returned DimensionConstraintNode object.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans