Open an existing entity record within a dialog box in model driven app power Apps
The below code can be used to Open an existing entity record within a dialog box in model driven app power Apps.
JavaScript
var pageInput = {
pageType: "entityrecord",
entityName: "contact",
entityId: "5a57f2c3-5672-ea11-a812-000d3a339706" //replace with actual ID
};
var navigationOptions = {
target: 2,
height: {value: 80, unit:"%"},
width: {value: 70, unit:"%"},
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
JavaScripthope it helps.