Issues while setting value for the field in Header of the form in CRM 2011

Hi,

We recently had a requirement to show in header of one of the form, the value from its related entity. So we thought that we will create a new custom field, move it to the header and populate it’s value using JScript in the onload event.

However as we were writing the JScript we realized that the field that is in the header of the form is not accesible using Xrm.Page.data.entity.attribute.

So the next thought was to add that field in the body of the form as well.

http://community.dynamics.com/product/crm/crmtechnical/b/crmcustomereffective/archive/2011/08/22/crm-2011-ability-to-add-the-same-field-to-the-form-more-than-once-and-javascript-challenges.aspx

So now we had that field in header as well as in the body. Now when we were setting the value of the field that was in the body, it was getting set properly as expected. But that value was not getting reflected in the same field in the header till we save the form.

We finally used document.getElementById to set the value for the field in the header.

Hope it helps.


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

1 thought on “Issues while setting value for the field in Header of the form in CRM 2011”

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s