ConfirmDialog in Power Apps using JavaScript
Using below code you can shoe a confirmation box using JavaScript which will display OK and Cancel Button. You can write your logic whn cancel button clicked and ok button clicked.
Below code calls from On Save and restrict save operation if Cancel is clicked and OK button allowed to save the record.
Pass executionContext parameter to the function.
var confirmStrings = { text:"The customer has no Home Loan in the system.Do you want to apply the loan?", title:"Confirmation" };
var confirmOptions = { height: 200, width: 450 };
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
function (success) {
if (success.confirmed)
{
alert("You have applied the loan");
}
else
{
var saveEvent = executionContext.getEventArgs();
saveEvent.preventDefault();
}
});
Hope It helps.