Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

I've rolled back my all entries when error occurred in loop al?

Posted on by 20

Hi,

I've rolled back all my entries when an error occurred. I 've a button and a code which  save the entries in loop but  I don't want to  rolled back the already saved  entries. Please anyone can help.

Categories:
  • n_dev777 Profile Picture
    n_dev777 20 on at
    RE: I've rolled back my all entries when error occurred in loop al?

    please can you share any example snippet or suggestion how to handle?  

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: I've rolled back my all entries when error occurred in loop al?

    Yes, if any error occurs then the entries written before commit will not be rolled back.

  • n_dev777 Profile Picture
    n_dev777 20 on at
    RE: I've rolled back my all entries when error occurred in loop al?

    but I want if any error is occurred then it will not be rolled back entries which are saved.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: I've rolled back my all entries when error occurred in loop al?

    Hi,

    Yes as per Mohana, you can use COMMIT function before your statement "until table.next = 0;"

    Thanks.

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: I've rolled back my all entries when error occurred in loop al?

    You can use Commit function.

    learn.microsoft.com/.../database-commit-method

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans