The DataAccessIntent property in Microsoft Dynamics 365 Business Central is used to define the level of data access that a particular user or process has when interacting with certain resources or data. This property is part of the context of permissions, ensuring that data access aligns with the intended business process and security model.
Sets the data access intent of the page.
This property applies to:
- Page
- Report
- Query
The property holds two distinct values:
- ReadOnly – Intent to access records, but not to modify them. Running read-only pages against a replica of the database improves performance but prevents modifications to the database records.
- ReadWrite – Intent to access and modify records.
There are two ways to control how your objects can read data from Business Central.
Option 1: AL Code
From Business Central Version 16, Reports, Pages (API Pages) and Queries have a new property called “DataAccessIntent“. If replicas are enabled, this property reduces the load on the primary database. DataAccessIntent property set to ReadOnly works as a hint for the server to route the connection to a secondary (read-only) replica, if one is available. When the system executes a workload against the replica, it throws a runtime exception if any insert, delete, or modify operations are attempted.
Option 2: User Interface
Below are what each option does:
- Default: the object uses the property value DataAccessIntent set on the AL.
- Read Only: the object uses the read-only replica, and that limits making any insert/update/delete to the data.
- Allow Write: the object uses the primary database, allowing insert/update/delete.
If you’re curious about how we can assist you in reaching your goals, don’t hesitate to get in touch. Our dedicated team is ready to provide support every step of the way.
Let’s turn your vision into reality together!