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)

get subGrid element by javascript

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I try to insert a fetchxml query into subgrid by javascript.

the problem is that i cano't accsess to the sub grid, i get a null object.

How can i do it in supporting way?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Hamzeh Zawahreh Profile Picture
    3,674 on at
  • Suggested answer
    Hamzeh Zawahreh Profile Picture
    3,674 on at

    hi also see this on Dynamically Filter form sub grid to show related records

    mahadeomatre.blogspot.com/.../dynamically-filter-form-sub-grid-to.html

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    Put your code under setinterval, so that it will execute after specified time, if subgrid object is not available, this is a loading issue.

    if(Subgrid==null)

    {

    setTimeout(function () { Functionname(); }, 2000); //if grid not loaded call it again

    return;

    }

  • Community Member Profile Picture
    on at

    Thanks for your reply'

    I wrote code like this and it didn't help. The problem is that it always returned null object.

    "document.getElementById("sub_securityCertification");".

    But if write in JQuery $('#sub_securityCertification');.

    i get an object. still it didn't help me because how i get the .control.setParameter("fetchXml", qeryFetch); function?

    thanks,

  • Suggested answer
    Rajkumar Rajaraman Profile Picture
    on at

    Hi Asher,

    Try this

    document.getElementById("sub_secutiryCertification_i");

    instead of

    document.getElementById("sub_securityCertification");

    Hope this helps.

    Regards,

    R.Rajkumar

  • Community Member Profile Picture
    on at

    Hi Rajkumar,

    It didn't help. i get that message: "document.getElementById("sub_secutiryCertification_i"); null Null

    ". on the quickView visual studio.

    but if i wirt this: "document.getElementById("sub_secutiryCertification_d". i get an object' but still the property and the method: "control.setParameter("fetchXml", qeryFetch);" not appears. can any help? or idea?

  • Community Member Profile Picture
    on at

    There is away to do it in server  side? c#?

  • Verified answer
    Hamzeh Zawahreh Profile Picture
    3,674 on at

    hi,

    You could also specify criteria and use a retrievemultiple call to pull a set of entities based on some criteria:

    see this link, have a lot of examples :

    social.microsoft.com/.../crm-2011-plugin-how-to-set-and-get-subgrid-in-plugin

  • Community Member Profile Picture
    on at

    Hi hamzech,

    Thanks u

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