web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Refresh parent page from the dialog in dynamics 365

(0) ShareShare
ReportReport
Posted on by 505

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 have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    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

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Priyank,

    Have you tried to use callback that is called when dialog is closed?

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    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 Bhavsar Profile Picture
    505 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans