web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Automate Gen Jnl Posting

(0) ShareShare
ReportReport
Posted on by 481
Hi everyone, 
 
We are trying to automate General Journal Posting (cash receipt journal) but are having issues with error handling. 
We would like to handle scenarios where one or more document numbers in the journal cannot post because of an error but we would like to continue posting the other lines. 
This is our scenario:
  • We have 2 custom tables called PaymentGroup and Payments Lines (one PaymentGroup can have multiple Payment Lines)
  • We extended the Gen Jnl Line with a new field called PaymentGroup ID
  • For each Payments Line, we create a journal line. In the journal line we record the PaymentGroup ID
  • The automation we're trying to build, loops the PaymentGroups -> finds the related journal lines and tries to post them.
We want an approach where all journal lines related to the same PaymentGroup should post successfully otherwise nothing should post for that PaymentGroup . 
 
Example: PaymentGroup with ID = PG1 creates 3 Journal lines with document numbers: D1, D2, D3. PaymentGroup with ID = PG2 creates 3 Journal lines with document numbers: D4, D5, D6. 
We are on purpose putting D2 out of balance to make it fail and we are ending up with D1 successfully posted and D2 and D3 not posted, still in the journal. In this case we are expecting that D1, D2 and D3 do not post while D4, D5, D6 post successfully. 
 
We tried to use the Gen Jnl Post Batch with suppress commit set to true but still got the same result. We have also tried using the Gen Jnl Post codeunit. We have also tried to use preview posting to validate the lines before attempting to actually post but preview posting always throws an error. 
 
Any help how this can be achieved?
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,216 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,471 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,369

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans