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?

ice1234
Helper I
Helper I

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

Do-the-flow
New Member

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

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Users online (3,892)