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)

is window.top.location.reload(); supported for dynamics crm online?

(0) ShareShare
ReportReport
Posted on by

Hi all,

Please let me know if  window.top.location.reload(); is a supported method to use in dynamics crm.

I use this to reload the page on click of a third party iframe subgrid. Wanted to know if this is a supported way. If not please tell me the supported way to refresh the entire page using javascript!

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    JohnAnonymous Profile Picture
    5,241 on at

    No, as far as I know, it's not supported and I don't think there's a supported alternative.

  • Suggested answer
    shivaram Profile Picture
    3,315 on at

    Hi Nithika,

    In my scenario, after clicking on ribbon button, I should open a Dialogue (Custom). So from that I should refresh parent window. So I used,

    parent.location.reload();

    And its working. You can try it once.

    Hope it helps you.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Nithika,

    location.reload is the JavaScript method which is just reloading the form which is equivalent to refresh the page. As it is not changing anything, this can be consider as *not* unsupported and again as is is not from the Xrm framework it doesn't fall into supported category as well.

    In short, it should work for you. However if you still want to go for supported alternatives, you can use below JavaScript.

    Xrm.Utility.openEntityForm("account", Xrm.Page.data.entity.getId());

    msdn.microsoft.com/.../jj602956.aspx

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     clicking F5 or ctrl+F5 in the browser can't be considered unsupported, and, so, window.top.location.reload() can't be considered unsupported either - that's just treating those manuals to the letter.. The idea is that you can't manipulate DOM model if you don't want to run into troubles. But window.top.location.reload() does not have anything to do with DOM manipulations - this method is available in all browsers (although.. what happens on mobile etc can be a different question)

     On a side note, window.top.location.reload() seems to be an equivalent of ctrl+f5(according to the post below), so it will reload all static content as well:

    stackoverflow.com/.../difference-between-window-location-href-window-location-href-and-window-location

    "Also note that location.reload() will also force reload all static content (much like a ctrl+f5 style hard refresh) whereas setting location.href back to href (or pathname or URL) does not, which could be a significant (and unnecessary) difference in load time on some pages"

    PS. Although w3schools disagree: https://www.w3schools.com/jsref/met_loc_reload.asp

    Looks like you have to pass true as a paremeter to reload the cache

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