Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Get Branch From Financial Dimension

Posted on by

Hi,

How to get branch from financial dimension in ax2012 through code? 

I'm using a table LedgerJournalTrans. 

Journal>InvoiceJournal>Financial Dimension.

Regards,

Zohan

*This post is locked for comments

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Get Branch From Financial Dimension

    Hi,

    You can use the following job/code to display the omoperatingUnit number, financial dimensions for a vendor ledger transaction.

    static void AXC_LedgerDimension(Args _args)
    {
        LedgerJournalTrans              ledgerJournalTrans;
        DimensionAttributeValueSetItem  dimensionAttributeValueSetItem;
        DimensionAttributeValue         dimensionAttributeValue;
        DimensionAttribute              dimensionAttribute;
        VendTrans                       vendTrans;
        VendTable                       vendtable;
        OMOperatingUnit                 OMOperatingUnit;
        DirPartyTable                   dirpartyTable;
        
        while select ledgerJournalTrans
            where ledgerJournalTrans.TransactionType == LedgerTransType::Vend
            join vendTrans
            where vendTrans.JournalNum == ledgerJournalTrans.JournalNum
            && ledgerJournalTrans.JournalNum == "XYZ"
            join vendtable
            where vendtable.AccountNum == vendTrans.AccountNum
            && vendtable.AccountNum == "V123"
            join dirpartyTable
            where dirpartyTable.RecId == vendtable.Party
            join OMOperatingUnit
            where OMOperatingUnit.RecId == dirpartyTable.RecId        
            join dimensionAttributeValueSetItem
            where dimensionAttributeValueSetItem.DimensionAttributeValueSet == ledgerJournalTrans.DefaultDimension
            join RecId from dimensionAttributeValue
                where dimensionAttributeValue.RecId == dimensionAttributeValueSetItem.DimensionAttributeValue
                join RecId, Name from dimensionAttribute
                    where dimensionAttribute.RecId == dimensionAttributeValue.DimensionAttribute
        {
            info(strFmt("Account:%1, OperatingUnit: %2, Name: %3, Value: %4", vendtable.AccountNum, OMOperatingUnit.OMOperatingUnitNumber, dimensionAttribute.Name, dimensionAttributeValueSetItem.DisplayValue));
        }
    }


  • RiccardoFiaschi Profile Picture
    RiccardoFiaschi 65 on at
    RE: Get Branch From Financial Dimension

    Hi Zohan,

    I still don't know exactly what you are trying to achieve but I assume you are trying to retrieve the value of a specific financial dimension from a record in the LedgerJournalTrans. I did a quick search and found the following two articles:

    The following article shows you how to retrieve a value based on the LedgerDimension field:

    axvuongbao.blogspot.nl/.../how-to-get-ledger-dimension-values-for.html

    But since you are talking about a vendor, I think you have a LedgerJournalTrans record where the AccountType == Vendor. In this case I think the following article would better suit your needs. This article will show you how to retrieve a value from the field DefaultDimension:

    www.andesoft.net/get-single-element-default-dimension-recid-ax-2012

    Hope that helps you out!

    Regards,

    Riccardo

  • Zohan Profile Picture
    Zohan on at
    RE: Get Branch From Financial Dimension

    I want to display the omoperatingUnit number against the vendor which will be in financial dimension. department, employee etc

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,269 Super User 2024 Season 2 on at
    RE: Get Branch From Financial Dimension

    Hi Zohan,

    What do you mean with a branch. Is it a specific name for a configured dimension? Please elaborate.

  • Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Get Branch From Financial Dimension

    Hi,

    Could you provide some more details about your requirement.When you say invoice journal is it sales (or) purchase and branch means are you referring to individual financial dimensions split.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans