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)

Accessing parent CRM page controls from custom HTML resource

(0) ShareShare
ReportReport
Posted on by 109

Hi all,

I have a custom html page that pops up on a click of a command bad button. This html page creates some records in CRM via javascript code and I want to refresh a sub-grid on the CRM form from which the html page was initiated. I tried using parent.Xrm.Page.getControl("my_subgrid").refresh() but it's not working as it's not fetching the sub-grid object. I'm getting an error:

Cannot read property 'refresh' of null

Has anyone ever succeeded doing something like this before?

Thanks,

-Tony.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Saad Kabarousse Profile Picture
    734 on at

    Hello,

    If you are on Dynamics 20111 use window.parent.xrm.page....

    on Dynamics CRM Version > 4 you should add

    <head>

    <title>HTML Web Resource</title>

    <script src="ClientGlobalContext.js.aspx" type="text/javascript" ></script>

    </head>

    and after that you can access SDK objects and fucntions,

    I hope this helps :)

  • Verified answer
    Pawar Pravin  Profile Picture
    5,237 on at

    Hi ,

    Try once using below syntax:

    window.top.opener.Xrm.Page.getControl("my_subgrid").refresh()

  • Tony Suslovich Profile Picture
    109 on at

    Hi Pravin, nice one! So replacing Parent object with window.top.opener object did the trick. Thank you!

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