Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to add onChange event in a field in header - Dynamics CRM online?

(0) ShareShare
ReportReport
Posted on by

I am working on a Dynamics CRM Online form. There is a Status Reason field in the header. I want add onChange event for this field.  

1. In the Form Properties editor window, header's controls are not visible in the control selection for adding event handlers.

2. Then I tries to use addOnChange method, I got errors "addOnChange" is invalid. 

    Xrm.Page.getAttribute("header_statuscode").addOnChange(ChangeStatusReason);

Thanks for reading my question, I appreciate your time for answering.

Runner288

*This post is locked for comments

  • RE: How to add onChange event in a field in header - Dynamics CRM online?

    Thanks for offering answer.

  • Suggested answer
    RE: How to add onChange event in a field in header - Dynamics CRM online?

    Andrii,

    I appreciate your time for helping me. Your second method works.

    Runner288

  • Verified answer
    Shantnu Sharma Profile Picture
    Shantnu Sharma 655 on at
    RE: How to add onChange event in a field in header - Dynamics CRM online?

    Make sure that field is present on the form as well (even if hidden is okay) and attach the event on that field on the form. This should work.

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: How to add onChange event in a field in header - Dynamics CRM online?

    Hello,

    Try to use

    Xrm.Page.getAttribute("statuscode").addOnChange(ChangeStatusReason);

    or alternatively if previous would not work

    Xrm.Page.getControl("header_statuscode").getAttribute().addOnChange(ChangeStatusReason);

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans