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

Community site session details

Session Id : auT/D9r7VavcZRwipSvtt7
Power Apps - Building Power Apps
Unanswered

Is window.parent.addEventListener supported?

Like (0) ShareShare
ReportReport
Posted on 18 Jul 2022 15:36:19 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? 
I have the same question (0)
  • Makarand Keer Profile Picture
    27 on 08 Sep 2024 at 07:15:33
    Is window.parent.addEventListener supported?
     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
    942 Moderator on 08 Sep 2024 at 13:24:20
    Is window.parent.addEventListener supported?
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 629 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 397 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 232 Moderator

Last 30 days Overall leaderboard
Loading complete