Search code examples
javascriptdynamics-crmmicrosoft-dynamicsxrmdynamics-crm-uci

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?


Solution

  • 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