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)

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

(0) ShareShare
ReportReport
Posted on by 1,532

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

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    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

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