Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

getEventSource is not working

Posted on by 105

Hi all,

Happy New Year!

I have multiple attributes on a form and they all fire the same js function. I need to dynamically fetch attribute name from which onChange handler gets fired. I do the following:

Tick 'Pass execution context' check box for each attribute's event handler.

js function I call takes executionContext as a parameter.

Then I fetch the object and then I try to fetch its name, but I'm getting an error.

var attribute = executionContext.getEventSource();
var attrName = attribute.getName();

I get an error saying that getName is not a valid function.

We have 8.2 version on-prem.

What am I doing wrong?

Best regards,

-Tony Suslovich.

  • RajuB Profile Picture
    RajuB on at
    RE: getEventSource is not working

    Thanks for letting us know it has been sorted out.

    Happy New year!!

  • Suggested answer
    Tony Suslovich Profile Picture
    Tony Suslovich 105 on at
    RE: getEventSource is not working

    Sorry everyone, false alarm. What happened was that I called the same function on FormLoad event and obviously there's no specific attribute in context at that point, so what I thought was an attribute, really wasn't. All sorted out now. Happy New Year!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans