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 :
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

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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);

  • Verified answer
    Shantnu Sharma Profile Picture
    655 on at

    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.

  • Suggested answer
    Community Member Profile Picture
    on at

    Andrii,

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

    Runner288

  • Community Member Profile Picture
    on at

    Thanks for offering answer.

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 Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans