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)

Auto Refresh After Updating The Records On Sub Grid Using JavaScript

(0) ShareShare
ReportReport
Posted on by

hi experts
Am Created JavaScript That Selects Multiple Sub Grids Records Updates Based On ribbon button. its working properly their issues found.

but we have to do manually refresh list.after Updating Record 
is their any possible to create auto refresh after updating the records.

Please give some suggestion
thank you
Naveen

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Tobias Koller Profile Picture
    on at

    hi,

    did you try something like

    Xrm.Page.getControl("MySubgridName").refresh()

    already?

    You can see the subgrid-Name in your form-Editor.

  • katikidalanaveen Profile Picture
    on at

    thanks for reply Tobias koller

    am already tried this code but its not working

  • katikidalanaveen Profile Picture
    on at

    actually we are trying to load Subgrid not whole Page In CRM

  • Tobias Koller Profile Picture
    on at

    maybe you can share some code where exactly you want to reload the subgrid. And maybe Show what you tried already.

  • katikidalanaveen Profile Picture
    on at

    Sure

    MarkAsClose = function (selectedIds) {

       if (selectedIds != null && selectedIds != "" && selectedIds.length > 0) {

           for (var indxIds = 0; indxIds < selectedIds.length; indxIds++) {

             UpdateSelectedRecords(selectedIds[indxIds]);

           }

           Xrm.Page.getControl("crmGrid").refresh();

           //alert("Selected Records MarkAsClose Successfully");

       }

       else {

           alert("No records selected!");

       }

    }

  • Tobias Koller Profile Picture
    on at

    are you sure that the subgrid is named exactly like "crmGrid"?

    please try this (just to be sure the grid is available and refresh-function exists):

    var grid = Xrm.Page.getControl("crmGrid");
    
    if(!grid)
    {
     alert("grid not found");
     return;
    }
    alert(grid.refresh); //should display a function
    grid.refresh();
    

    you could also try to add a timer so you have some time to scroll to the subgrid and watch carefully if it gets refreshed.

    setTimeout(
                function(){
                    Xrm.Page.getControl("crmGrid").refresh();
                }
            , 10000); //10 seconds time
  • Pranesh M Juwale Profile Picture
    1,196 on at

    Hi Sk,

    check this link:

    joegilldotcom.blogspot.in/.../crm-2011-how-to-refresh-form-after.html

  • katikidalanaveen Profile Picture
    on at

    And Koller the 2 Methods are not working and second thing our code Implemented when we select a record in sub-grid  on click of Button. Record will Update and that why we are trying to Auto Refresh sub grid.

  • katikidalanaveen Profile Picture
    on at

    thanks Pranesh Juwale . Our Code Implemented on Button. Not on Form On load Event.

  • Tobias Koller Profile Picture
    on at

    do you get any error-Messages? which 2 Methods are not working?

    maybe you can post a screenshot (of the Form where the subgrid and Buttons are shown) that I'm sure we are talking about the same Part in CRM.

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