{Useful to Know} Using HTML 5 session storage feature in Dynamics CRM web resources

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.

 

image

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!

Advertisements

Author: Debajit

I am a Dynamics CRM Most Valuable Professional (MVP) with 10 years of experience in Microsoft .NET Technologies and 7 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

1 thought on “{Useful to Know} Using HTML 5 session storage feature in Dynamics CRM web resources”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s