Because the representation of a Textbox field is a simple string and it is not formatted as in the case of a Richtextbox, the result is that the text showed is similar to an HTML content.
This is not user friendly for CRM users, therefore we should remove all the tags and let only the original content; obviously, we will lose the formatting (bold, underline, etc...).
We can do that with JavaScript, using the regular expressions, as shown below:
var richTextBoxContent =
Xrm.Page.getAttribute("richtextbox_attribute_name").getValue();
var richTextBoxContentStripped =
richTextBoxContent.replace(/(<([^>]+)>)/ig, '');
Xrm.Page.getAttribute("text_attribute_name").setValue(richTextBoxContentStripped);
Hope it can be useful.
Happy CRM coding.
Rate this posting:
{[['']]}
You can visit this website and find out more info about MS codes. More helpful info and tips for you.
ReplyDeleteOn my website you'll see similar texts, write what you think. database management
ReplyDelete