
We are using below script for getting app name
function appName()
{
var appName;
var globalContext = Xrm.Utility.getGlobalContext();
globalContext.getCurrentAppName().then(
function success(app)
{
appName = app.uniqueName;
console.log(appName);
},
function (error) {
appName = "";
}
);
alert(appName);
}
But result is "undefined"
Expected result is "appname"
Hi,
You code does not seems to be correct. Please try below code -
async function CheckAppForSpecificName(){
retVal = false;
var globalContext = Xrm.Utility.getGlobalContext();
await globalContext.getCurrentAppName().then(function(appName){if(appName=='MyAppName'){retVal = true}}, function(err){console.log('err ' + err.message)});
return retVal;
}
dynamicsjourney.wordpress.com/.../
Please mark my answer verified if this is helpful!
Regards,
Bipin Kumar
Follow my Blog: xrmdynamicscrm.wordpress.com/