Email Description Field / Body field and JavaScript in CRM

Hi,

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

http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/e349b7fc-f42a-4fa5-aaa4-ba01673a73ed

 

Bye..


Author: Nishant Rana

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

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