web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Is window.parent.addEventListener supported?

(0) ShareShare
ReportReport
Posted on by 5

Hi, 

I am working on a PCF control that populates data on the dynamics 365 form. I have found one from PCF gallery that creates a custom event window.dispatchEvent(customEvent) and JavaScript web resource listens to the event using window.parent.addEventListener. This seems to be working for me. However, Could anyone please let me know if window.parent.addEventListener is supported way on implementation in dynamics?
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi vbaaz,

    Based on the following threads, Accessing DOM is not supported by DYnamics 365 which is why it has stopped working, but it can work through PCF.

    (+) window.addEventListener is not working in Dynamics 365 - Dynamics 365 Customer Service Forum Community Forum

    Solved: Cannot read property 'addEventListener' of null at... - Power Platform Community (microsoft.com)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Travis South Profile Picture

Travis South 37

#2
11manish Profile Picture

11manish 33 Super User 2026 Season 2

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 18

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans