Full Rollback in Batch Posting

navuser1
Member Posts: 1,334
Hello,
There is scenario where I make two sales orders during a process, and I have to post them right away. If the system fails to post any of them under any circumstances, I would like it to roll back entirely.
How can I use the Business Central platform (AL Code) to accomplish this?
Please share your knowledge about it.
Kindly, ignore this topic if you have already gone through the same question in the Dynamics 365 Community forum.
Regards,
SB
There is scenario where I make two sales orders during a process, and I have to post them right away. If the system fails to post any of them under any circumstances, I would like it to roll back entirely.
How can I use the Business Central platform (AL Code) to accomplish this?
Please share your knowledge about it.
Kindly, ignore this topic if you have already gone through the same question in the Dynamics 365 Community forum.
Regards,
SB
Now or Never
0
Answers
-
I have seen it on Dynamics 365 Community Forum as well. So have you found a solution for it?United Kingdom0
-
So far, I have not found any solution.Now or Never0
-
When you call to the posting codeunit to achieve this, you have then posibility of passing a "SuppressCommit" parameter to avoid commit for each recor you pass, and commited at the end.
This way if any error occurs during the hole process, the rollback do not create, modify, delete, any registers in the database1 -
Exactly the same approach I have already implemented.
Now or Never0 -
United Kingdom0
-
By Standard the posting routine will commit, I didn't know MS introduced SetSupressCommit function, in the old days we used a blank error to prevent the commit in the code (Error(''))
My understanding is you have some piece of code (bespoke) that fails sometimes but the document has already been posted. I would review if you have your piece of code in the right place as it should happen before any commits, it would rollback by default.
0 -
SetSupressCommit only supresses any explicit call to Commit during the execution of the Codeunit. This allows you to include more database changes into the same transaction such as updating bookkeeping daten related to some interface to an external system. As such it is very different from Error('')1
-
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions