Notifications
Announcements
No record found.
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
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
Priyank,
Have you tried to use callback that is called when dialog is closed?
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)
Callback function is somehow not working. Xrm.Utility.openEntityForm(entityName, id) serves my purpose.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2