Please wait
Talk to Expert
Microsoft Dynamics Business central

DataAccessIntent Property in Business Central

Banner_DataAccessIntent Property in Business Central (1)

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: 

  1. 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.
  2. ReadWrite – Intent to access and modify records. 

Business Central can employ read-only replications of the primary (read-write) database. Using a database replica alleviates the burden on the primary database. In some circumstances, it will also boost performance when viewing data in the client. Replicas are useful for viewing data in objects such as reports, queries, and API pages without modifying it.

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 

Another option is to change the Data Access Intent property for the objects directly through the user interface. This approach provides a simple and straightforward way to make the necessary adjustments.

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!