How it works...

Using isolated storage ensures that the data you put in there is not accessible outside of your application. This is extremely useful when it comes to storing things such as license keys, API keys, and integration connection information.

Entries in isolated storage have a defined scope, which means you can further control how accessible the data is. This is done using the datascope parameter, which has the following options:

  • Module: Available to the entire application
  • Company: Available to a specific company
  • User: Available only to a specific user
  • CompanyAndUser: Available to a specific company and user

Why did we add these functions to a page object instead of a central codeunit?

The answer is rather simple, but easy to overlook. The point of isolated storage is to protect the data that you store there. If you put functions in a codeunit, then you have to make global functions to get/set the data, which means that if another developer creates a dependency on your app, they will be able to access your global functions, and therefore will be able to retrieve (or change!) your sensitive data.

By creating local functions within the object that is interacting with the sensitive data, the functions are not accessible to any other application, even if a direct dependency is created between them.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset