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)

any way to set form header field values with xrm?

(0) ShareShare
ReportReport
Posted on by

Hello - I'm trying to set a header field value on my case form with xrm.  However, Xrm doesn't seem to pick up the field reference, because it's in the header. Is there a workaround for getting and setting field header values?  Or is this not possible with CRM?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    jlattimer Profile Picture
    24,564 on at

    There isn't a supported way to handle this with Xrm methods. A supported option would be to use an HTML web resource with some JavaScript either in the page itself or have the web resource accept the values.

    Sample: Pass Multiple Values to a Web Resource Through the Data Parameter

    Showing related information in a CRM 2011 form

  • CList Profile Picture
    on at

    The workaround you're looking for is the following bit of javascript:

    ...if the header field you want to set is called "XXX"...

    document.getElementById("header_XXX_d").firstChild.innerHTML = 'blah blah blah';

    ...IE development tools (F12) are your friend!

    The key thing here is that this is UNSUPPORTED - the question is; is that a bad thing?

    Because CRM is simply a .Net web application, like any other .Net web application (though a rather large and fancy one), almost anything is *possible*, it's just not *supported*.

    That means that when it's time to upgrade, you may have to figure out a new workaround. In my experience, this is a balancing act of effort now vs effort later, but I've found that doing a quick elegant workaround now and then figuring out how to do it again in 4 years when a new release comes out often takes less time than jumping through hoops to create a less-than-optimal UI experience in some "supported" way.... especially since that "supported" way may still break when a new release comes out - as many of us experienced when we upgraded from CRM 4 to CRM 2011 and saw changes to many of the old documented APIs.

    Cheers!

    C.List

  • Suggested answer
    Community Member Profile Picture
    on at

    You can add the field to the form and make it invisible to the form that the user sees.

  • Mohsin Ali Profile Picture
    3,634 on at

    Andrew, Its late but hopefully it'll help others.

    dynamicscrm2011blogs.blogspot.com/.../how-to-set-header-field-value-in.html

  • Community Member Profile Picture
    on at

    for such situation.. the field which is on header in the CRM form.. should be added in the form body also (so now on form the same field will be on two places)... and update the field (which is on body) by javascript (to update you can use the Xrm object like this Xrm.Page.getAttribute("fieldname").setValue('xyz')).... you will see that on update the header field will also get updated... this is totally a supported method... today I was stuck in the same situation and  then found this solution.. :).. you can hide that field on form body..

    I know it is very late response to this post... but will help anyone :)

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock 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