I'm opening a dialog using Xrm.Utility.openDialog method.
Is there a way to refresh the parent page when a button is clicked in the dialog?
*This post is locked for comments
I'm opening a dialog using Xrm.Utility.openDialog method.
Is there a way to refresh the parent page when a button is clicked in the dialog?
*This post is locked for comments
Callback function is somehow not working. Xrm.Utility.openEntityForm(entityName, id) serves my purpose.
Hi Priyank,
Try with this -
if ((window.opener && (typeof window.opener !== "undefined")) && (window.opener.Xrm && (typeof window.opener.Xrm !== "undefined"))) { window.opener.Xrm.Page.data.refresh(); // You can also write like below to reload--Xrm.Utility.openEntityForm(entityName, id) } // Or you can also try if ((window.parent && (typeof window.parent !== "undefined")) && (window.parent.Xrm && (typeof window.parent.Xrm !== "undefined"))) { window.parent.Xrm.Page.data.refresh(); }
I am not sure , I have not tried , however I would suggest try to debug and write(window.parent.Xrm or window.opener.Xrm or may be window.praent.opener.Xrm) in console when you are getting parent Xrm object. Once you get the object you can do refresh using
Xrm.Page.data.refresh()
or
Xrm.Utility.openEntityForm(entityName, id)
Priyank,
Have you tried to use callback that is called when dialog is closed?
You can pass a callback function to openDialog, which will be called when the dialog is closed, and in the callback you can call the Xrm.Page.data.refresh method. However, there's no supported way to attach code to button clicks within the dialog
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,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156