Skip to content Skip to sidebar Skip to footer

How Do I Refresh The List On The Homepage View Of An Entity

I have a custom ribbon button on one of my CRM 2011 entities that will effectively disable that entity. I then would like to refresh the current view on the homepage of that entity

Solution 1:

Good question. Here are two ways you can do it:

//refreshes the entire element in the parent window that contains the viewwindow.parent.opener.location.reload();

//refreshes just the grid control that contains the view (probably what you're looking for)window.parent.opener.document.getElementById("crmGrid").control.refresh();

Solution 2:

If someone is coming here for Dynamics 365

Do the following for the custom Ribbon Button:

  • Add the PrimaryControl as CrmParameter to your JS function
  • Use the following code to refresh the list:
    function yourJSFunction(primaryControl) {
        // Do your stuff
        primaryControl.refresh();
    }
    

    Example for Xrm.WebApi.online.executeMultiple(...):

    function yourJSFunction(primaryControl) {
        // Create the requests// ...
    
        Xrm.WebApi.online.executeMultiple(requests)
                         .then(function (result) {
                             primaryControl.refresh();
                         });
    }
    
  • Post a Comment for "How Do I Refresh The List On The Homepage View Of An Entity"