Sunday, June 17, 2012

MS CRM 2011 - Javascript function to detect Offline/Online mode

The following example shows how to enable or disable a MS Crm Tab when an user tries to go in offline mode or in online mode. In this case i try to disable the tab that contains an Iframe with a Custom Service Calendar.


// Comment
HeadServiceCalendarInOfflineMode: Function()
{
//Check if mscrm is in online or offline mode

if(!isOnline)
{
try
{
Xrm.Page.ui.tabs.get("service_calendar_Tab").setVisible(false);
}catch(err){}
}

}


Nicola Grillo