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)

Get Branch From Financial Dimension

(0) ShareShare
ReportReport
Posted on by 2

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

I have the same question (0)
  • Chaitanya Golla Profile Picture
    17,225 on at

    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.

  • André Arnaud de Calavon Profile Picture
    301,053 Super User 2025 Season 2 on at

    Hi Zohan,

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

  • Zohan Profile Picture
    2 on at

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

  • RiccardoFiaschi Profile Picture
    65 on at

    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

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    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));
        }
    }


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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans