1
votes

I am developing a small customization in AX 2012, which will enable user to import Item Movement Journal Lines from Excel, in item movement journal we have to set OffsetAccount for every line, this is creating problem for me, I want to read the offset account from excel and set it for the line(in my case it is "110110 Bank Account USD"), I noticed that in InventJournalTrans table the field (LedgerDimension) is populated with a recId, but when I try to read this rec ID from excel and set it for InventJournalTrans, it tells me that this field does not exists.

My ultimate goal is to set the one single offset account for all lines, I can put it in excel or if anyone can show me how to display a segmented entry control for this purpose.

Any help would be much appreciated.

2

2 Answers

0
votes

Why not use the Excel add-in?

It handles surrogate keys automatically (if the table is properly defined). RecId should never be read from Excel!

Regarding journal imports, see this link.

0
votes

I resolved this issue by creating a method in my class which will take account no (read from excel) and get its recid from table DimensionAttributeValueCombination table then I save this recId for LedgerDimension, here is my code:

public RecId getDimensionRecID(str _DisVal) 
{    
    DimensionAttributeValueCombination davc;
    RecId rrr;
    Name disValue;
    disValue = _DisVal;    
    select firstOnly * from davc where davc.DisplayValue == disValue;
    rrr = davc.RecId;
    return rrr; 
}