Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Using on Onload event to add a Grid control addOnLoad is not working

(0) ShareShare
ReportReport
Posted on by 1,530

I GUESS I DID NOT TRY ENOUGH!!!

I FOUND MY ISSUE!!! PLEASE DISREGARD THIS POST!!!

Hi,

Using Microsoft Dynamics® CRM 2016(8.1.0.359) (DB 8.1.0.359)

I have tried everything to get this to work and the below logic does not work.  I can not get the "onGridLoad" to trigger.  Is there something else I need to be adding.

Xrm.Page.getControl("GridName").addOnLoad(onGridLoad);

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


I have looked at the following links and neither is working for me.

https://www.inogic.com/blog/2015/11/api-functions-to-control-subgrid-behavior-starting-dynamics-crm-2015-update-1/

https://community.dynamics.com/crm/f/117/t/271605

www.crmanswers.net/.../bind-function-to-subgrid-refresh.html

I FOUND MY ISSUE!!! PLEASE DISREGARD THIS POST!!!

*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    gdas 50,089 on at
    RE: Using on Onload event to add a Grid control addOnLoad is not working

    Hi ,

    Seems when you are executing or attaching the

    addOnLoad event , the grid control not fully loaded.

    So please try with this -

    // call below method in form on load

    function formonLoad()

     {

       var grid = Xrm.Page.getControl("GridName");

       if (!grid) {

         setTimeout(formonLoad, 1000);

         return;

       };

       grid.addOnLoad(SubgridOnLoad);

     }

    function SubgridOnLoad()

    {

    }

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans