I was recently asked for assistance to troubleshoot an eConnect integration that involved importing Dynamics GP transactions with Analytical Accounting distributions.
The user was able to import the transaction, but the imported transaction did not have the associated Analytical Accounting data in GP. There were a few mistakes in the import, and there were a few missing values that produced some misleading error messages from eConnect, so I thought I would briefly describe how to include Analytical Accounting data in an eConnect import.
First, make sure to fully review the information in the eConnect Programmer's Guide related to the taAnalyticsDistribution node. There are a few misleading elements and one inconsistency that may trip you up.
Let's review a few key fields in the help file:
DOCNMBR: This should be the Dynamics GP document number, such as the Journal Entry or Voucher Number. In the case of a PM voucher, this should not be the vendor's invoice / document number.
DOCTYPE: This is NOT the same numeric doc type value of the main transaction being imported. If you scroll to the bottom of the taAnalyticsDistribution help page, you will see a list of AA DOCTYPE values that you should use depending on your main transaction type.
For example, if you are importing a PM Voucher, the value should be zero, which is different than the DOCTYPE=1 you would use in your taPMTransactionInsert node.
DistSequence: If the GL accounts in your distributions are unique, this field is optional. If you have duplicate accounts in your distribution, you must supply this value, which means you will likely also need to assign the DistSequence value in your transaction distributions so that you can know the values and pass them to AA.
ACTNUMST: The GL account number for the distribution line related to this AA entry. I don't understand why this value is marked as Not Required. Obviously if you are sending in DistSequence, then ACTNUMST would be redundant, but I would recommend always populating this value.
As for the AA distribution values, you also need to ensure that you are passing in valid AA dimension and code values, that the combination is valid, and that the values can be used with the specified GL account. This is one thing that can make importing AA data so tedious--if the customer is regularly adding AA codes or GL accounts, an import may fail if everything isn't maintained and updated in GP. I validate all of the AA data prior to importing, as it is much easier for the user than getting eConnect errors.
Here is a snippet of the AA code from a GL JE import I developed. As long as you properly assign the handful of AA values, it should be fairly straightforward.
aaDist.DOCNMBR = trxJrnEntry.ToString();
aaDist.DOCTYPE = 0; //0 = GL JE Transaction
aaDist.AMOUNT = Math.Abs(lineAmount);
aaDist.DistSequenceSpecified = true;
aaDist.DistSequence = lineSequence;
aaDist.ACTNUMST = lineAccountNumber;
aaDist.DistRef = lineDescription;
aaDist.NOTETEXT = longDescription;
aaDist.aaTrxDim = aaDimension;
aaDist.aaTrxDimCode = aaCode;