Get Current Model-Driven App Properties

To perform business logic or restrict your business logic to particular app only, you can use microsoft cliet API reference getCurrentAppProperties. 

you can refer below link for different properties of model driven app : 

Following is the example how you can use app properties to restrict your business logic: 

getAppName: function(executionContext) {
    var formContext = executionContext.getFormContext();
    var globalContext = Xrm.Utility.getGlobalContext();
    globalContext.getCurrentAppProperties().
    then(
        function successCallback(app) {
            var appName = app.uniqueName;
            var appId = app.appId;
            alert("app name : " +appName+ " app Id : " +appId);
            if(appName == "Your app name") {
             //perform your business logic here   
            }
        },
        function errorCallback() {
            console.log("Error");
        }
    );
},

Comments

Popular posts from this blog

Accessing Fields on QuickView Form through javaScript

ADF - (Part 2) Integrate Data From CRM to External system

Power Apps Portals - Lock/Unlock User Account for Invalid Sign In Attempt