Email Description Field / Body field and JavaScript in CRM


To set description field in email with formatting instead of DataValue we need to use

document.all[‘descriptionIFrame’].contentWindow.document.body.innerHTML="One <br/> Two";

as it is rendered as IFrame.

And in form’s onload to set it we need to use script like this

document.all[‘descriptionIFrame’].attachEvent( "onreadystatechange", stateChanged)
function stateChanged()
     if (document.all[‘descriptionIFrame’].readyState==4 ||document.all[‘descriptionIFrame’].readyState=="complete")
     document.all[‘descriptionIFrame’].contentWindow.document.body.innerHTML='<span style="color: #6600cc">this </span>is a <span style="font-weight: bold; font-style: italic">test</span>’;

Check the entire thread here !!



Author: Nishant Rana

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

Please share your thoughts

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.