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
Post a Comment