Saturday, December 28, 2013

Importing the daily journal in MsDynamics Ax 2012

Importing the daily journal in Microsoft Dynamics Ax 2012



During a data migration project the the following two topics should be imported
    1.   Open balances for vendors
    2.   Open balances for customers.

In this blog I will try to explain how to use the ledger accounts and dimensions
Technically I have to say, it’s a big challenge to understand the concept and why it’s changed.           But the functionality is improved a lot. The financial dimensions are now really unlimited and can         be used per company, in multiple companies, per team, per customer or what ever. This is really       powerful for international companies as you can track international projects and compare them         to budgets.
Let’s go back to the technical part. There are multiple ways to store information into the ledger             journal. One of the changes is that dimensions can be added to the ledger account it self. Which         can have a lot of power in many cases as you can have a ledgger and offset ledger account with         their own dimensions.

There are more ways to create dimensions. You can checkout the support site from Microsoft             which is pretty useful. Check out these blogs.
It’s still possible to create scripts which will update the ledgerJournalTrans table. Most of the things are still similar. The big change is the ledger account and offset ledger account assignment. It’s not complex but you can use classes and containers. We have chosen to use the container as it is really easy to implement. The ledger account can now contain also the dimension values and these should be combined on creation. The structure in the container is:
  • Display value (combination of all values)
  • Account number (vendor account, customer account, ledger account…)
  • Number of financal dimensions
  • dimension name
  • Dimension value
  • dimension name…

The second step is to read the struct and convert the values to the container and buildup the display value. After that the container can be completed with the ledger account. Now you can call the magic method to convert this container into a record id.
AxdDimensionUtil::getMultiTypeAccountId (for customers, vendors, projects etc)
AxdDimensionUtil::getLedgerAccountId (specific for ledger accounts).
Based on what we tested only ledger accounts can have dimensions.

str account = '1234567';

LedgerJournalTrans journalTrans;

Struct ledgerDimensionStruct;

Str displayValue;

int NumberOf = ledgerDimensionStruct.fields(), i = 1;

Container retValue;

retValue = [account];

// add the dimensions to a struct

ledgerDimensionStruct.add('department', "OU_1");

ledgerDimensionStruct.add('Purpose', "New project");

if (NumberOf > 0)

{

retValue += NumberOf;

}

displayValue = account;

while (i <=NumberOf)

{

retValue += ledgerDimensionStruct.fieldName(i);

retValue += ledgerDimensionStruct.valueIndex(i);

displayValue += strFmt('-%1', ledgerDimensionStruct.valueIndex(i));

i++;

}

// create a container with all the values

retValue = [displayValue] + retValue;

// Store the created recid tot the ledger dimension

journalTrans.LedgerDimension = AxdDimensionUtil::getMultiTypeAccountId(enumNum(LedgerJournalACType), journalTrans.accountType,NewledgerDimension);


Hope that this blogs can help to get started with financial dimensions. I still have some open ends on more places, but we are getting more and more into it.
One question I have is: there is a ledgerDimension and a defaultLedgerDimension. What is the difference and how should this be used?


Have a good day and of course any comments are welcome,

I-ace Technologies and Services

No comments:

Post a Comment