Dynamics Business Central / NAV Developer Digest - Vol. 499

Dynamics Business Central / NAV Developer Digest - Vol. 499

ArcherPoint’s Developer Digest focuses on Microsoft Dynamics 365 Business Central and Dynamics NAV development. This week’s volume includes AutoIncrement counter behavior in testing environments, mirroring an Azure SQL Business Central database in Fabric, C# scripts in Azure Logic Apps workflow, and a question on SQL statement performance.

The Dynamics 365 Business Central community, consisting of developers, project managers, and consultants, collaborates across various platforms to share valuable insights. At ArcherPoint, we greatly value their dedication and expertise. To ensure widespread access to this technical knowledge, we created Developer Digest.

Understanding the AutoIncrement counter behavior in testing environments

Jon Long posted:

Testing Framework Behavior of AutoIncrement=true:

  • When running tests in the Business Central testing framework, ALL database changes (such as inserted records) are rolled back to maintain the integrity of the test environment.
  • However, the AutoIncrement counter is not rolled back as part of this transaction. This means that even though the records created during the test are rolled back, any AutoIncrement fields continue from the next number in the sequence when the next record is created.

As you can imagine, this can create problems, especially if you use an AutoIncrement field as a primary key and are testing in both the Test Framework AND doing manual testing.

The cool thing about it is you can use this “feature” as a counter in your tests since it is reliably persistent.

Mirroring an Azure SQL Business Central database into Fabric

A new feature just out of preview allows Business Central users to mirror their Azure SQL database into Microsoft Fabric. Even updates, deletes, and inserts are mirrored in near real time.

While there are some limitations to mirroring Azure SQL databases in Fabric, this capability provides exciting new possibilities for analyzing data in Business Central.

Find out more by reading Bert Verbeek’s blog, Mirroring your Azure SQL Business Central Database.

Give your low code workflow a performance boost!

Did you know you can write C# scripts and execute them in your Azure Logic Apps workflow?

This can be a real lifesaver when performing complex operations within a low-code workflow. Those types of scenarios can adversely affect system performance. Being able to inject code can help give you the performance boost you need in those situations.

Stefano Demiliani discusses this process in his blog, Running inline C# scripts in Azure Logic Apps workflows.

Are 2 SQL statements better than 1? Let’s check…

So, a question posed by Alexander Drogin on LinkedIn sparked some lively debate about the usefulness of using a combination of checking if a set is empty first before requesting the set of records. Specifically, does it improve query performance to run “if not IsEmpty()” before running “FindSet()” in Business Central code, or should you just run “FindSet()” and be done with it?

Aside from the initial reaction that “2 SQL roundtrips instead of 1 is always to be avoided,” Waldo considered the instance where there ARE times when two statements can be faster than one. That prompted him to test the two scenarios to see if there was a clear winner.

Check out the results in Waldo’s blog, IsEmpty + FindSet or just FindSet?

Don’t miss out

Join us for Days of Knowledge Americas 2024 in Atlanta September 12-14. Register now!

++++++++++++++++++++

Are you interested in Dynamics NAV and Business Central development? Check out our collection of NAV/BC Development Blogs.

Read “How To” blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV and Dynamics 365 Business Central.

Trending Posts

Stay Informed

Choose Your Preferences
First Name
*required
Last Name
*required
Email
*required
Subscription Options
Your Privacy is Guaranteed