I’m trying to do something which I thought would be relatively easy, but apparently is not.
I’m trying to combine a GL account and financial dimensions to get a GL-and-dimension combination which will eventually populate the LedgerDimension field on a LedgerJournalTrans record.
I have two fields:
Field 1 (call it VarianceLedgerDimension):
A LedgerDimension value, coming from a field I added to the MarkupTable table.
I understand that this field contains a recID that points to a record in the DimensionAttributeValueCombination table.
My user will select a GL account from a control I’ve added to the MarkupTable form. That is the main account number I want to use when creating a LedgerJournalTrans record
In my example, the GL account that the user selected is 5590.
I manually browsed the DimensionAttributeValueCombination table for my VarianceLedgerDimension value, and verified it is the record I want.
The record pointed to by this LedgerDimension recid has a DisplayValue of “5590”, LedgerDimensionType of ”Default account”, and a MainAccount value (recId) which points to the MainAccount record for GL account 5590, which is correct.
Field 2 (call it LineDefaultDimension):
A DefaultDimension value. This is copied directly from the DefaultDimension field from a PurchLine record
It looks like a RecId, but I’m not sure what table it is a recid for. If I at least understood that much, it would hopefully clarify my understanding a bit.
In my example, my PurchLine has the following dimensions (as shown on the Purchase Order Details form, Line Details fasttab, Financial Dimensions tab)
Location: 10
Commodity: 350
Sub-commodity: 3620
What I want to do is create a new LedgerDimension value (call it FinalLedgerDimension) which is a combination of the main account number from my VarianceLedgerDimension, and the dimension values from my DefaultDimension.
Once I get that FinalLedgerDimension value, I will put that value in the LedgerJournalTrans.LedgerDimension field on a new AP Invoice Journal transaction I am creating in code.
The end result will be a LedgerDimension value which points to a record (presumably a record in the DimensionAttributeValueCombination table) which will look like the following when I look at it on the journal voucher form:
5590-10-350-3620
There has to be some way to combine the GL account number and financial dimensions to get the LedgerDimension value I need to accomplish this, creating a new record in DimensionAttributeValueCombination if necessary
I’m still getting up to speed on AX2012 after working in AX2009 for years, and the whole change to how GL accounts and financial dimensions are handled is really confusing to me. I have read the white paper from Microsoft about implementing the account and financial dimension framework, but I think that confused me even more.
I would appreciate any help. You may need to walk me down the primrose path a bit and point me to specific class and method names I need to call to get my desired end result.
Bill Yater
Blue Horseshoe Solutions, Inc