Notifications
Announcements
No record found.
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
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.
Hi Zohan,
What do you mean with a branch. Is it a specific name for a configured dimension? Please elaborate.
I want to display the omoperatingUnit number against the vendor which will be in financial dimension. department, employee etc
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!
Riccardo
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2