Business Central Isolated Storage: Keep Out of my Data!

Microsoft Dynamics 365 Business Central Application Developers often need to store sensitive information their application uses. In earlier Dynamics NAV versions, developers often saved this data in table fields. The table field values were accessible to any other application or user that had access to the table. Information such as API keys, user credentials, or any additional information there is a desire not to have easily accessible was often stored and easily read from the table. Thankfully there is a more suitable way to do this in Business Central – Isolated Storage.

Isolated Storage in Microsoft Dynamics 365 Business Central is data storage that isolates data between extensions and even within the Extension. An application developer can store Key-Value Pairs in Isolated Storage and define the stored data’s scope (access level). Isolated Storage Key-Pairs’ DataScope can be limited to the Extension, a specific Company, a particular User, or a specific Company and User combination, providing an easy way for a developer to save values with a limited access scope.

Isolated Storage data isolation is accessed with the IsolatedStorage Data Type. The IsolatedStorage DataType provides methods to Set, Get, Delete or check if a Key Contains a value. 

The Set Method saves a Key-Value Pair to Isolated Storage within the scope defined in the DataScope parameter. 

The Get Method retrieves the Value for a Key in the scope defined by the DataScope parameter.

The Contains Method determines if the Key has a value in the scope defined by the DataScope parameter.

The Delete Method deletes the Value of a Key in the scope defined by the DataScope parameter.

For more information, see Isolated Storage.    

Note: The code listed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 1

Leave a Reply

Your email address will not be published.