BC Friday Tips #13 Be careful with the hidden ๐—–๐—ผ๐—บ๐—บ๐—ถ๐˜!

Time for BCFridayTips for the BC consultants.

Be careful with the hidden ๐—–๐—ผ๐—บ๐—บ๐—ถ๐˜!

When a ๐—–๐—ผ๐—บ๐—บ๐—ถ๐˜ statement is executed, it ends the current write transaction and registers the changes in the database. If an error occurs after the Commit, those changes wonโ€™t be rolled back, potentially leading to a partial commit issue.

Here’s an example:

Consider the table 99000786 โ€œ๐—ฅ๐—ผ๐˜‚๐˜๐—ถ๐—ป๐—ด ๐—ฉ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ปโ€ and its โ€œ๐—ฆ๐˜๐—ฎ๐˜๐˜‚๐˜€โ€ field validation.

Commit on Status Validation

In this code, a ๐—–๐—ผ๐—บ๐—บ๐—ถ๐˜ is triggered when the ๐—ฆ๐˜๐—ฎ๐˜๐˜‚๐˜€ field is validated.

We need to be aware of this.

Why?

โœ… ๐—”๐˜ƒ๐—ผ๐—ถ๐—ฑ ๐—ฝ๐—ฎ๐—ฟ๐˜๐—ถ๐—ฎ๐—น ๐—ฐ๐—ผ๐—บ๐—บ๐—ถ๐˜. If an error occurs after a Commit, it is impossible to roll back everything completely.

Even though the commit statement isnโ€™t used frequently, itโ€™s important to check for it when working with any objects in BC so you can handle it accordingly.

thatnavguy

Experienced NZ-based NAV Developer and Consultant with 15+ years of experience leading multiple IT projects, performing business analyst, developing, implementing, and upgrading Dynamics NAV and Business Central. Passionate to deliver solution that focuses on user-friendly interface while keeping high standard of compliance with the needs.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *