In a recent project while working on client-side scriptings, we had come across a requirement where we interact with Dynamics 365 CRM data using WebAPI and query expressions. In most cases, we needed the current Model-driven app AppId to build the WebAPI URLs. We had achieved this by using Dynamics CRM Client API references.
With the help of Client API references, we can read the current Model-driven app details. Please find the Client API references below, using which we can get the current Model-driven app details.
With the use of getCurrentAppProperties client API reference, we can get the current Model-driven app details. Please find the code below:
var globalContext = Xrm.Utility.getGlobalContext(); globalContext.getCurrentAppProperties().then( function successCallback (appDetails) { alert('App Details found'); }, function errorCallback() { alert('Error'); });
With the use of getCurrentAppName…