Hi,
We have a custom control that allows to open the defaukt form of the entity displayed in the form.
dataController.openEntityForm = function ($event, item, row) { var entityFormOptions = {}; entityFormOptions["entityName"] = item.LogicalName; entityFormOptions["entityId"] = item.Id; Xrm.Navigation.openForm(entityFormOptions); }
Now, we need to ask first a question before the redirection to the entity form.
Only on a positive answer, we should redirect.
I looked into the openConfirmDialog, but as it is async in V9.0, I need to pass parameters to it.
Anyone who can help me with this?
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then( function(success) { if (success.confirmed) { //redirect : how to get name and id? } else { //do nothing } }, function(fail) { //TODO TO DO : check if we can display an error } );
Thanks
Birgit
Hi,
I defined the entityFormOptions before the openConfirmDialog, en tried to pass it as a parameter.
I solved it slightly different, but it is clear to me how to use it correctly.
Thanks for feedback
Hello Birgit,
What issues do you experience? It should work fine like:
dataController.openEntityForm = function ($event, item, row) {
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
function(success) {
if (success.confirmed) {
var entityFormOptions = {};
entityFormOptions["entityName"] = item.LogicalName;
entityFormOptions["entityId"] = item.Id;
Xrm.Navigation.openForm(entityFormOptions);
}
else {
//do nothing
}
},
function(fail) {
//TODO TO DO : check if we can display an error
}
);
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156