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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Saving changes to record without using commit

(0) ShareShare
ReportReport
Posted on by 134

Hi there, 

I am currently trying to find a way how to 'avoid rolling back' changes done to a field in a set of records after an error is encountered at a later stage i.e. say you have 5 records in total and you manage to successfully modify the field in the first 4 but if an error is encountered in record 5 then the first 4 records are saved with the change and not rolled back. 

I am trying to avoid the use of COMMIT after every record change and was wondering if there is a way how to do it otherwise. 

Just FYI , the change in the record is happening by calling a function in a codeunit. I have also tried to call the codeunit function from a report i.e. in report I have the below; 

IF MyCodeunit.MyFunction(Record) THEN BEGIN

//Make field modification

END;

Thanks in advance! 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 on at

    Why you don't want to use the COMMIT? You can use the CODEUNIT.RUN to catch errors but you still need to run COMMIT to update.

  • Verified answer
    ManishS Profile Picture
    86 on at

    I don't  think there is another way, cause if there is any error every thing shall rollback.

  • Y_NAV_1716 Profile Picture
    134 on at

    Thanks for your input :) It's not about not wanting to use COMMIT ... just wanted to check if maybe there is another way how to do it. Will still probably end up using COMMIT now.

    Thanks again!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans