Looking at the title of the topic, you must be wondering, is it something really related to Dynamics CRM. Well I would say a big Yes. Because it is an excellent HTML 5 feature and we develop HTML 5 webresources in our day-day activities. Being a dynamics crm consultant we sometimes tend to miss out on some cool stuffs outside our CRM universe. For those who have missed out this one, I bet you would love it.
Many a times when we open a HTML webresource on the click of a ribbon button or some element click on the CRM entity form, we tend to pass parameters to the webresource. And sometimes we need to persist the value of the parameter in the webresource even if the webresource is refreshed.
Well you can use the cool HTML 5 feature of sessionStorage.
The sessionStorage persists as long as the browser window is open and gets deleted once you close the browser tab/ window. Another cool stuff about this is that it follows the standard key/ value model of storing the value just like any modern language.
Below is the sample code of how to set and get values from the sessionStorage.
It will persist your page refresh and unlike cookies it does not get posted to the server every time you submit your page.
Hope this helps!
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.
Reblogged this on Dynamicsofdynamicscrm and commented:
This is interesting post on HTML 5 storage from my old colleague and Friend Debajit