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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Is window.parent.addEv...
Power Apps
Unanswered

Is window.parent.addEventListener supported?

(0) ShareShare
ReportReport
Posted on by 14

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?
If this is not supported what is the best solution to update a form field from the PCF control? 
Categories:
I have the same question (0)
  • Makarand Keer Profile Picture
    27 on at
     Hi,
     
    I have similar requirements, but in my case I am listening to an event inside my PCF component and window.dispatchEvent(customEvent) is raised by JS on D365 form. But It is not working and my event handler which I wrote in PCF’s index.ts never gets called.
     
     
  • Shashank Bhide Profile Picture
    946 Moderator on at
    I think from Dynamics point of view it should be good and supported, another way I'd explore is to use postMessage instead of dispatchEvent as the former one works across windows. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 833

#2
Valantis Profile Picture

Valantis 563

#3
Haque Profile Picture

Haque 383

Last 30 days Overall leaderboard