So, now the question is - How can we open any modal pop-up form on record click of subgrid without actually opening the record in full view and also without making that grid editable?
The answer is-
Step 1: We first need to change the control from the "Read-Only grid" to the "Power Apps grid control".
var ArpitaD365Learning= window.ArpitaD365Learning|| {};
(function () {
this.onRecordSelect= function (executionContext) {
try {
var pageInput = {
pageType: "entityrecord",
entityName: executionContext.getEventSource().getEntityName(),
entityId: executionContext.getEventSource().getId(),
// Add the GUID of the form which you want to open in the modal form
formId: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
};
var navigationOptions = {
target: 2,
height: { value: 70, unit: "%" },
width: { value: 70, unit: "%" },
// position 1 for dialog in the center, 2 for the far side
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
console.log("Success log");
},
function error() {
console.log(error.message);
});
}
catch (error) {
console.log(error.message);
}
}
}).call(ArpitaD365Learning);
No comments:
Post a Comment