cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jamz
Frequent Visitor

Create record in Business Central Journal Lines

The Power Automate action Create Record in Business Central journal lines, doesn't have the fields/object to fill in journal batch ID or journal ID. But when tested, the error says "You must specify a journal batch ID or a journal ID to get a journal line."

Has anyone successfully used Power Automate to create records in BC journal lines? If so, what's the work around this limitation?

 

Thanks.

15 REPLIES 15
ryguyt
New Member

Initially it contains the fields to specify organization and table name, once the table name is selected (journalLines), I wait a few second and new fields appear below including the journalId. Although I'm entering the journal batch into the journalId field, I'm getting the same error as @Jamz 

Jamz
Frequent Visitor

We found a workaround using HTTP Post Method to load SQL rows to BC journal line.

Anonymous
Not applicable

Care to elaborate?

Anonymous
Not applicable

Did you ever figure this out? Seems absurd to me that they have a pre-built connector, but somehow you need fields that aren't available.

RobF
Advocate I
Advocate I

The is how we got this working:

 

Use HTTP GET to retrieve the record by filtering on the Journal Batch Name:

RobF_0-1648579392612.png

 

Use Parse JSON with the HTTP Body as input:

RobF_1-1648579442071.png

 

The Parse JSON will output all the journal table fields including the GUID, which we assign to a variable and then use as input for the standard BC actions:

RobF_2-1648579530862.png

 

RobF_3-1648579657546.png

 

Anonymous
Not applicable

Thanks for the reply. I think I saw your other post on this method as well (after some extensive Googling). However, isn't the journal batch ID a static value? I traced between the Journal Batches view, which it's called SystemID in and then at journal line level it's called the JournalBatchID. So could we not just force the static value in Power Automate if we know the Journal BatchID? You would need some logic in your flows to set different IDs then based on what type of batch you wanted to use then (if you're using multiple batches). Do you think this would work? 

 

Also, how are you using that BatchID when creating the journalLines in Power Automate?

 

RobF
Advocate I
Advocate I

@Anonymous Yes I think you are correct, the journal batch GUID is static and you could use that instead of the journal batch name in the workflow steps if you know the GUID value in advance.  In our case the data in our SQL table already has the batch name assigned.  We also found for troubleshooting Power Automate errors that it is easier to see the journal batch name instead of the GUID in the output.

 

For loading the journal lines, we are using HTTP POST, only because the standard journalLines API v2.0 doesn't have fields for inputting the Dimensions, which we require, and so we published our own Web Service page for it.

 

RobF_0-1648581036025.png

 

Anonymous
Not applicable

Ah. I hadn't even got that far to notice. I would also require dimensions. Pretty severe limitation of the Power Automate connector for BC.

 

May I ask what tables did you need to expose to web services to get that to work?

RobF
Advocate I
Advocate I

Hi, we published page 39 General Journal to load the journal lines.

Anonymous
Not applicable

HI, thanks for this info, I am facing the same issue since the dimensions are not exposed via the business central connector. Can you expand on your authentication method for your API call? I am seeing using token, azure api, but I was wondering if there was something simpler that I am missing?

Has anyone found a solution to this? I have the journalbatchID and I'm using that in the JournalID column and I get this error message. It works in another flow but not this one and I can't figure out why. 

ryguyt
New Member

@ice1234 I was only able to get this working using @Jamz solution, which was detailed by @RobF above

Ok, perhaps this will help people, I was struggling with this error initially with Business Central / Power Automate.

 

First I created a G/L batch named "AUTOMATE" in business central.

Finance > General Journals > + New > Name=AUTOMATE, Description=Power Automate Journal Batch

Dotheflow_0-1668453362124.png

 

Next I'm going to use the Find Records to locate the AUTOMATE code

The key is to filter the search using ODATA startswith(code,"AUTOMATE") and set the Top Count to 1 (only want the 1 record, however it will still be an array of records, even if it's 1).

Dotheflow_3-1668453769858.png

 

And then I just used the "id" from the Find Records, because it's an "array of 1", it wraps "Apply to each" around it.

I tried using the select and compose/parse json to avoid the apply to each but wasn't having quick success and didn't want to play around with it, if anyone knows how to eliminate the apply to each would be perfect.

Dotheflow_4-1668454240698.png

I see the journal line in my AUTOMATE batch in Business Central:

Dotheflow_5-1668454994688.png

 

Now in business central I can filter the batch and post the journal lines that I want from the batch.

Great work, but can you add dimenions?

doufu
New Member

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.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,045)