3
The COUNTAPPROX statement in Navision / Business Central is one of the most useless out there today because it provides a value that is very different of the real value.

The SQL SERVER low-level implementation of COUNTAPPROX is not at all clear or non-existent in the official documentation:

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-countapprox-method

Someone said this some years ago:
https://forum.mibuso.com/discussion/comment/209451/#Comment_209451

In the other side, the COUNT statement seems to LOCK the tables, either the physical Table or the Indexed View associated with the calculated fields and this makes you doubt about using it in contexts in which you are experiencing many locks in those tables with very many records.

https://vjeko.com/2017/03/09/when-you-just-must-count-no-matter-what/

My suggestion is that the low-level implementation of COUNTAPPROX does the same as COUNT does but just adding the corresponding WITH (NOLOCK) modifier to the SQL SELECT COUNT or SELECT SUM statement.
Category: Development
STATUS DETAILS
Completed
Ideas Administrator

Thank you for your feedback. It seems that requested feature has meanwhile been made available as part of the ReadIsolation property on the Record Type.

Please refer to the following link for more information:

It also means that it should be possible to implement your scenario in current AL

Best regards,
Business Central Team