{"title":"DataAccessIntent Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-dataaccessintent-property/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-dataaccessintent-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-dataaccessintent-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sets the data access intent of the page.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":101,"chars":35},{"level":2,"title":"Property value","slug":"property-value","at":136,"chars":353},{"level":2,"title":"Syntax","slug":"syntax","at":489,"chars":59},{"level":2,"title":"Remarks","slug":"remarks","at":548,"chars":2564},{"level":3,"title":"Page","slug":"page","at":1259,"chars":380},{"level":3,"title":"Query","slug":"query","at":1639,"chars":433},{"level":3,"title":"Report","slug":"report","at":2072,"chars":1040},{"level":2,"title":"Related information","slug":"related-information","at":3112,"chars":364}],"text":"> Version: _Available or changed with runtime version 5.0._\nSets the data access intent of the page.\n## Applies to\n Page\n Report\n Query\n## Property value\nValue|Available or changed with|Description\nReadOnly|runtime version 5.0|Intent to access records, but not to modify them. Read-only pages are run against a replica of the database leading to improved performance, but preventing modifications to the database records.\nReadWrite|runtime version 5.0|Intent to access and modify records.\n## Syntax\n```al\nDataAccessIntent = ReadOnly|ReadWrite;\n```\n## Remarks\nFor reports, API pages, and API queries, the Business Central server can use read-only database replicas on Azure SQL Database and SQL Server. If replicas are enabled, use this property to reduce the load on the primary database. Using ReadOnly might also improve performance when viewing objects. ReadOnly works as a hint for the server to route the connection to a secondary (read-only) replica, if one is available. When a workload is executed against the replica, insert/delete/modify operations aren't possible. If any of these operations are executed against the replica, an exception is thrown at runtime. The following sections explain how this property is handled on different object types.\n### Page\nThe property only applies to pages of type API. The devenv-editable-property must be set to false. When an OData call fetches data from the page, then it's only the call to fetch the data that uses the read-only replica. Database calls needed in setting up the API page are performed against the primary database, for example, database calls in the OpenCompany triggers.\n### Query\nThe property only has an effect on queries exposed through OData (API queries). It has no effect in normal code paths. When an OData call fetches data from the query, then it's only the call to actually fetch the data that uses the read-only replica. Database calls needed in setting up the session before retrieving data are performed against the primary database, for example, database calls in the OpenCompany triggers.\n### Report\nThe property also affects reports generated in UI sessions. The database calls needed while iterating through data items use the read-only replica if it's set. Records read before and after generation of the data set are read from the primary database.\nFrom the client, the property value can be overwritten by using page 9880 Database Access Intent List page.\nWhen calling an API page or API query, the property value can be overwritten by specifying HTTP request header `Data-Access-Intent`.\n> NOTE\n> Setting the DataAccessIntent property to ReadOnly doesn't guarantee that your data access will be running on the secondary replica. It's merely stating that the code only requires read ability, so a read-only connection can be used.\n> For example, the property doesn't apply to queries running at arbitrary times during normal AL execution (that is, the server doesn't change to ReadOnly mode in the middle of a transaction). So for queries, the property only fully applies when they're exposed as an API/OData feed directly.\n## Related information\nUsing Read Scale-Out for Better Performance<../../administration/database-read-scale-out-overview>\nOptimizing SQL Server Performance<../../administration/optimize-sql-server-performance>\ndevenv-properties\nPage Properties<devenv-properties>\nSpecifying Data Access Intent for REST API GET requests<../devenv-connect-apps-tips#DataAccessIntent>"}