{Quick Tip} – Wanted to know whether your client code is running on-premise or online in Dynamics 365? Use the isOnPremises() method in Global context

For training, consulting and our products, please write to us at – info@xrmforyou.com

Recently I faced this scenario where I needed to determine based on whether I am on-premise or online, I needed to write my logic accordingly. We have our popular Sharepoint Utility which is used by a lot of customers and we had to perform special operations depending on whether it is installed on-line or on-premise.

Xrm.Utility.getGlobalContext() gets the global context and has method to know whether your model driven app is hosted on-premise or online.

To get the value first the get the global context

var globalContext=Xrm.Utility.getGlobalContext();

var isOnPremises = globalContext.isOnPremises();

Simple yet effective built-in method available in global context.

Hope it helps!

Debajit Dutta

(Business Solutions MVP)

For training and consulting, write to us at info@xrmforyou.com