Think Dynamic, Do Dynamic Microsoft Dynamic CE | Powerapps || Dynamic CRM || Power Apps || Power Platform || Canvas App || D365CE

HOW TO GET THE APPID OF A DYNAMIC 365 POWER APP USING JAVASCRIPT

 This one’s pretty useful when you’re building out URLs in your JavaScript and you are using the AppId of your model-driven Power App / Dynamics 365. You don’t ever want to hardcode these values, and you will need to move your code across your environments at some point so getting this value programmatically is the best approach.

In the account page below, we see in the URL the AppId of our App – 0da29984-d407-ea11-a81e-000d3a35b116:

 Now, let’s go into debug in the browser and run the code below (of course, you can run this anywhere you need to):

var globalContext = Xrm.Utility.getGlobalContext(); 
globalContext.getCurrentAppProperties().then( function success(app) 
{ console.log(app); },
function errorCallback() 
{ console.log("Error"); });

When we run this, we see in passing a variable into the first parameter (appId), it gives us several pieces of information, including the appId, displayName, uniqueName, url, webResourceId, webResourceName, welcomePageId and welcomePageName:

Read More

Share:

0 Comments:

Post a Comment

Dynamic 365

Talha Manzoor. Powered by Blogger.

Contributors

Ex-QB Mark Sanchez arrested, faces three possible charges

  Ex-QB Mark Sanchez arrested, faces three possible charges Former NFL quarterback and current Fox Sports broadcaster Mark Sanchez was arres...

Search This Blog

Design by - Blogger Templates | Distributed by Talha Manzoor

Social

pictory

No Thumbnail

No Thumbnail