Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Validate Dimension Value with Account Structure

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have a DimensionValue and Account Structure and i have to validate that Dimension Value with Account Structure..... 

Dimension Value as [MainAccount-BusinessUnit-Department-CostCenter-ItemGroup]

Accounting Structure as "Manufacturing P&L"

Any Help Guys??

*This post is locked for comments

  • Validate Dimension Value with Account Structure
    hi , DimensionValidation::validateByTreeForCombination is this method no longer exists , and if exists in which class can ypu please help
  • Verified answer
    Khaled Alloud Profile Picture
    Khaled Alloud 3,658 on at
    RE: Validate Dimension Value with Account Structure

    Dear,

    Check below:

    valueContract = new DimensionAttributeValueContract();

           valueContract.parmName(DimensionAttribute.Name);

           valueContract.parmValue(DimensionAttributeValueSetItem.DisplayValue);

           listValueContract.addEnd(valueContract);

    Thanks,

  • RE: Validate Dimension Value with Account Structure

    Hi Kaled Alloud,

            Thank you for your response , may i know the input format of LedgerAccountContract , i'm getting error when i pass it as

    listValueContract.addEnd("MainAccount");

       listValueContract.addEnd("401300");

       listValueContract.addEnd("BusinessUnit");

       listValueContract.addEnd("003");

       listValueContract.addEnd("Department");

       listValueContract.addEnd("024");

       listValueContract.addEnd("CostCenter");

       listValueContract.addEnd("013");

       listValueContract.addEnd("ItemGroup");

       listValueContract.addEnd("AudioRM");

    Error : "Function DimensionDefaultingEngine::constructForMainAccountId has been incorrectly called."

  • Verified answer
    Khaled Alloud Profile Picture
    Khaled Alloud 3,658 on at
    RE: Validate Dimension Value with Account Structure

    Hello Vairam,

    For this there are 2 ways, either from AX or by code:

    1- By code you might use this sample code (i can't share the full code here because too long):

       ledgerAccountContract.parmValues(listValueContract);

       dimStorage = DimensionServiceProvider::buildDimensionStorageForLedgerAccount(LedgerAccountContract);

       dimensionAttributeValueCombination = DimensionAttributeValueCombination::find(dimStorage.save());

       ledgerDimension = dimensionAttributeValueCombination.RecId;

       dimStorage = DimensionServiceProvider::buildDimensionStorageForLedgerAccount(ledgerAccountContract);

       dimensionValidationStatus = DimensionValidation::validateByTreeForCombination(dimStorage,dateNull(),true,true);

    2- You can create a new PO and add an item to the lines. Then go to Line details > Financial dimension tab. Here you can insert the combination you want, and then click on Financials > Distribute amounts :  if the combination is not valid you will see red box in the line.  You can change the Main account from Item group > Purchase order > Purchase expenditure for product , and then Reset the validation from Distribute amounts.

    Make sure to reset the correct setup if you change it.

    Thank you,

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,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans