Unable to upload AP invoices with DMT 4.0.58.0 for Epicor 10.1.400

Hi,
I’m trying to upload a AP Invoice file with DMP, always is coming the same error

2020-08-10T10:20:07 Company xxx VendorID yyyy InvoiceNum ser005 Table: APInvHed Msg: A valid Invoice Number is required.
A valid Invoice Number is required.

Any idea what could go wrong ?
The columns that I used for template are

Company
InvoiceNum
InvoiceDate
TermsCode
GroupID
InvoiceAmt
Description
CurrencyCode
GLControlCode
RateGrpCode
VendorNumVendorID
APInvDtl#InvoiceNum
APInvDtl#InvoiceLine
APInvDtl#PartNum
APInvDtl#ExtCost
APInvExpTGLC#GLAccount
APInvExp#InvExpSeq

APInvoice-Mod.csv (404 Bytes)

Please find the template. Make sure that you check both Add and Update option. It could be an issue with DMT version as well as AP Invoice Combined is highly unpredictable based on my experience.

@sergiu
Error reported for all the records or few ?

The error comes from BO Erp.APInvoice.ChangeVendorID

When using the standard Invoice Entry, Epicor is sending only the “VendorNum”, and the “InvoiceNum” is empty, while when using DMT, you have to sent the “InvoiceNum” as well.
Looking on the trace, when DMT is executed, in the “Erp.Proxy.BO.APInvoiceImpl”, you’ll see that in the parameters section we have the “InvoiceNum” with the value that is provided, while in the same “Erp.Proxy.BO.APInvoiceImpl”, in the “” the InvoiceNum comes back empty.

The way that I found to make it working:

  1. in BO -> Erp.APInvoice.ChangeVendorID in Pre-Processing section, set a BPM DataField (like ShortChar01) to the value of the InvoiceNum
  2. in BO -> Erp.APInvoice.ChangeVendorID in Post-Processing section, set back the field ttAPInvoiceNum = ShortChar01 (from BMPDataField)m then set this ShortChar01 to empty.

It’s just working, and in what I see the records are created in tables Erp.APInvHed, Erp.APInvDtl and Erp.InvcMisc(for transaction).
The question is if this change in directives doesn’t affect something were we don’t expect.
Also this custom directive that we create in Erp.APInvoice.ChangeVendorID have to be somehow isolated, to be executed only when the transaction comes from DMT.
Probably that adding a custom column with a boolean value when uploading with DMT and then check it in Pre-Processing, will help to isolate this transaction at DMT level only.

I used this template, may be even some of the columns can be removed.
Template APInvoiceCombined.csv (537 Bytes)

1 Like

I know this is ‘Necroposting’ but I found out that if you move the VendorNumVendorID before the InvoiceNum in the DMT file it doesn’t error. I generated a DMT that was successfully loaded and then created another one that got the error so I was really confused what I did differently and searched the forums for this thread.

I then went through and saw the difference in the files changed it and then re-ran it without issue.

Just a FYI for anyone who may run into this in the future.

YACNU (Yet Another Contextual Necroposted Update)

Just because the scenarios here are related and led me to a solution, another place this problem showed up is in building an Efx function to create groups and invoices in 2022.1

In a trace everything behaves as expected, but in the function this method:

apInvCon.ChangeInvoiceDateWithDateCheck(dateInvoiceDate, reCalc, out cMsgText, out dateMsg, ref apInvDS);

Where apInvCon is my implementation of APInvoiceSvcContract, completely blanks the invoicenum and invoiceref fields from the dataset! Worse, this runs (according to trace, after the apInvCon.ValidateInvoiceID(strVendorID, strInvoiceNum, out outValidationVendorNum, out outLogAPInvFound) method, which has already determined at that point that the invoice number is fine.

I was able to solve it by re-editing the dataset just before calling UpdateMaster, which was throwing the “Valid Invoice Is Required” error:

      apInvDS.APInvHed[0].InvoiceNum = strInvoiceNum;
      apInvDS.APInvHed[0].InvoiceRef = strInvoiceNum;

And now UpdateMaster seems happy.