Thursday, November 15, 2018

Sometimes you have to explicitly create Dynamics GP Batches with eConnect

By Steve Endow

You just can't know everything.

Maybe I never took the time to look at this one field when using that particular Dynamics GP batch posting setting, and never knew about this quirk.

Maybe I did know about this quirk at some point over the last 12 or 13 years working with eConnect, but forgot about it.

Either way, I didn't know about it when I needed to know about it.

Last week I had a call with a customer to try and troubleshoot a weird posting date issue.  They import a bunch of AP Invoices every Monday morning into dozens of batches, review the batch that Monday or Tuesday, and then post the batch.  Simple, right?

But when they were reconciling the GL for their month end close, they were seeing AP Invoice transactions post to prior weeks and prior fiscal periods.  An invoice imported on November 5 posted to October 30.  Another invoice imported on November 5 posted to November 1.

It was weird.

We looked at their GP posting settings for Payables Transaction Entry, and it looked pretty normal.

Typical Batch Posting Date

The customer is using the Posting Date from the Batch.  Okay, so that rules out an issue with the invoices posting based on the Transaction posting date.

But, that doesn't explain why invoices imported at the same time on Monday morning would post to different dates.



I asked the customer if maybe a batch from Monday October 29 could have remained unposted, and received new transactions on Monday November 5.  The customer said no, they post all of these AP Invoice batches each week.  And even if one or two batches wasn't posted, that wouldn't explain why transactions were posting on different dates.  The import only runs on Monday morning, yet they were seeing invoices posted on every day of the week.

Weird.

So if the AP Invoice batches were being created fresh each Monday morning, and if the customer is using a Batch Posting Date, why would the batch posting dates be different?

While on the call with the customer, it dawned on me.

What if:  I send an invoice to eConnect.  If the batch doesn't exist, eConnect creates the batch.  But instead of using the current date as the batch posting date, eConnect, for some hair brained reason, uses the first invoice date as the batch posting date?

Naw, that would be silly.  Surely eConnect wouldn't do that, right?

So I tested the import with a few AP Invoices.  And what do you know.  eConnect created the batches using the first invoice date it received.  It didn't use the current date, and it didn't update the batch date for any additional invoices that were imported to the batch.

eConnect Don't Care

Yes, I can hear you now.  "Duh! I TOTALLY knew that! Everyone knows that! How could you not know that?"

"Even I knew that!"

Like I said, you can't know everything.

Fortunately, now that I knew the problem, I knew how to fix it.  I had previously developed an integration that explicitly created batches, so was able to copy that code and update it for this project.


eConnect has the taCreateUpdateBatchHeaderRcd, which despite its name, appears to only create a batch.  As far as I can tell, it doesn't actually update an existing batch, at least not in my testing with a Payables Transaction Entry batch.

So, I just finished modifying the integration and will deploy the new version tomorrow.

Fortunately, I figured out the problem, and it was an easy fix.  But it was yet another reminder that despite having worked with eConnect for over a decade, there are still lots of things I don't know about it.



You can also find him on Twitter and YouTube




1 comment:

  1. Hi Steve - I ran into the same issue with Purchasing batches. My work-around was to run a task after integration to set the batch date today, as the client always wanted to use today as the posting date. Agree that eConnect is great, but has some mystery.

    ReplyDelete

All comments must be reviewed and approved before being published. Your comment will not appear immediately.

How many digits can a Business Central Amount field actually support?

 by Steve Endow (If anyone has a technical explanation for the discrepancy between the Docs and the BC behavior, let me know!) On Sunday nig...