Raj Rao
Raj Rao

Reputation: 9138

How to determine if Dynamics XRM javascript is being invoked from the unified interface (UCI) or the legacy web-client?

There is the function: Xrm.Internal.isUci(), but that is labelled as Internal, so its most likely not supposed to be used. But, I need a method to determine if my code is being invoked from the UCI or from the legacy web-client (because, there are behavior differences in how the code behaves).

Is there a supported mechanism to determine this?

Upvotes: 2

Views: 2153

Answers (2)

Aron
Aron

Reputation: 3935

Another supported option that might work:

var globalContext = Xrm.Utility.getGlobalContext();
globalContext.getCurrentAppProperties().then(successCallback, errorCallback);

Upvotes: 0

This is what we are using today, which is supported & working for us:

function isUCI() {
   var globalContext = Xrm.Utility.getGlobalContext();
   var t1 = globalContext.getCurrentAppUrl();
   var t2 = globalContext.getClientUrl();
   return t1 !== t2;
}

Community thread on same topic

Upvotes: 2

Related Questions