Skip to main content

Notifications

#10 Open URL in PowerApps/Dataverse form Using JavaScript

Implementation Steps:

 

Syntax:

 

 

 

Xrm.Navigation.openUrl(url,openUrlOptions)

 

 

 

 

Consider am having a field in an Account Entity Called URL. Then in Onload of Page, if URL Field Contains Data Open another Page with URL

 

To Begin with i created a Field Called URL in Account Form

rampprakash_0-1634019498527.png

 

Then Create a WebResource File with Type as JS

rampprakash_1-1634020115162.png

 

 

function openURLOnLoad(executionContext) {
 var formContext = executionContext.getFormContext();
 if (formContext.getAttribute("cr608_url").getValue() != null) {
 var URL = formContext.getAttribute("cr608_url").getValue();
 var openUrlOptions = {
 height: 800,
 width: 800
 };
 Xrm.Navigation.openUrl(URL, openUrlOptions);
 }
}

 

 

Then Call the function in OnLoad Opearation

 

rampprakash_2-1634020208004.png

 

Save and then Publish

 

Create a Record in Account Entity 

rampprakash_3-1634020285670.png

 

Save then Refresh the Form

 

rampprakash_4-1634020327591.png

 

That's it 🙂

 

 

 

Comments

*This post is locked for comments