Friday, April 22, 2022

Power Automate Business Central Journal Line Import Error

by Steve Endow

NOTE:  I'm encountering this error as of April 22, 2022.  If this ends up being a bug in the Power Automate BC connector that is fixed, I'll post an update.

A customer is interested in importing General Journals into Dynamics 365 Business Central using Power Automate.

Simple, right?  Just one Power Automate flow, right?  How hard could it be, right?

Well, it depends.

This is the error that I get in my Power Automate environment.

You must specify a journal batch ID or a journal ID to get a journal line

When I ask why it doesn't work, I get responses that seem to indicate that it should work.

"It works fine for me"

"You must be doing it wrong"

"Did you try doing it this way?"

But no matter what I try, the flow gives me the same error:

ErrorCode: Application_DialogException  You must specify a journal batch ID or a journal ID to get a journal line.  

My flow is VERY simple.  It has a single step:  Create Record (V3)

Simple, right?

I am using the Journal ID from an existing General Journal batch in Business Central.  I retrieved the GUID using Postman, and am able to insert Journal Lines in Postman using the GUID.  But Power Automate is telling me that I "must specify a journal batch ID or journal ID".

For context:  I am able to successfully insert a General Journal Line using the Business Central Web API using Postman.  Here  is Postman using the same Journal ID GUID to add a line to the same General Journal batch.

Postman can insert a Journal Line successfully

Aside from the bug in the Journal Line API page related to the Balancing Account, the Journal Line API endpoint does seem to work.

But when I attempt to use the Power Automate Business Central Create Record (V3) connector, I always get the above error.

So I had a call with my friend Tanya Henderson.  She created a new flow in her Power Automate environment and attempted to insert a Journal Line into her Business Central environment.  Completely different environments--no connection to mine.

She received the same error.  So how are people getting this flow to work?

I then had a call with Mary Thompson.  She created the same simple flow to import a Journal Line into Business Central.  IT WORKED FOR HER.

She recommended enabling the Experimental Features option in Power Automate, in case that might allow me to access updated Business Central connectors in my Flow.  

Enable Experimental Features

After enabling this setting, I logged out completely, logged back in, and had to create a new flow in order to access the updated Business Central connector.  Enabling Experimental Features did change the Business Central connector--the drop downs were completely different.

But it still did not work for me.  The new flow with the new connector gives me the same error.

So, it appears that there is a bug in the Power Automate Business Central V3 connector when calling the Journal Line Web API.  BUT, the connector apparently in some environments, but not in others.

If you have any information about the bug or how to work around it, please let me know!

Steve Endow is a Microsoft MVP in Los Angeles.  He works with Dynamics 365 Business Central and related technologies.

You can also find him on Twitter and YouTube, or through these links:

1 comment:

  1. Not sure if this has been resolved but I have encountered the same error lately and here is what I had done.

    The error could be due to the "CheckFilters" procedure in the "journalines" API. It requires that the "Journal Batch Id" and "SystemId" not be empty.

    How to create a journal line via Power Automate flow. Create a custom API in BC based from the original "journallines" API. Then comment out the logic in "CheckFilters" procedure and add fields "Journal Batch Name", "Journal Template Name", and the Dimension fields in the custom API.

    In Power Automate flow, call the custom API instead of the BC standard API and insert the Journal Batch and Template Name with the other details accordingly.


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...