Wednesday 5 August 2015

Dynamics CRM Rich Text HTML Editor with TinyMCE Solution

Introduction

We all know that CRM records except Email Template or Email cannot have Rich Text HTML Editor  using CRM Out of The Box Feature. In some situations, we might need this requirement, for example, when we need to supply data to CMS System that need fancy color, fancy formatting, superscript, and subscript as well, we can’t just supply them the plain text only without styling and HTML formatting.

Solution

So, this is one of our requirement in the project, so, together with my geek colleague, JVS Segador trying to make it happens using tinyMCE.


There are 3 choices we can use:

1. Use HTML Web Resources
Then we place it in to the CRM Form

2. Use custom page like ASPX hosted somewhere and then put as iFrame

3. Convert text field in CRM to Rich Text Editor with some ‘hack’ and ‘tweak’

For those we still need the TinyMCE libraries, so the purpose of my blog post now is to help you using the TinyMCE by providing you the CRM solutions I have compiled.

Steps & Download Link

1. You just need to import it to your CRM and choose 1 of 3 choices by referencing its libraries.

Finally, you can download here:

TinyMCE Solution for CRM 2013
*This example is for CRM 2015 Online (with Online Updates 1), so should work for now.


2. Create a HTML, a new Web Resource, then You can refer to the library you have installed into your CRM Solution, for example:

image

3. Then you need a javascript to get the content and to grab it and save it to the expected field value.

To grab the value you can use this:

var xContent = tinyMCE.get('textareaID').getContent();
//or
var aContent = tinyMCE.activeEditor.getContent();

*Note: In the next post I will provide the full HTML Code as solution

4. Put the HTML to the CRM Form

5. For adding new Plugin or new fancy functionalities you can add more plugin libraries that TinyMCE provides to you all.

Result


And here is the result:

image

Thanks to TinyMCE Team! Good night here

21 comments:

  1. Hello! How to get "tinyMCE.activeEditor.getContent();" from webresources on crm form javascript file (crm 2015 online update 1)?

    ReplyDelete
  2. How will this affect looking at this information in Pane view? Notes, tasks, anything else with Details created with Rich Text would show-up as garbage in the Pane view. Any suggestions around this? Or would Pane views of this information just be useless? I also thought about creating a Text version of the data without Rich Text for when the Rich Text data is created, but if someone updates this in a Pane view it would overwrite the Rich Text version.

    ReplyDelete
  3. You can now use the ideas above to incorporate the feature-rich Tiny MCE editor using either the managed or unmanaged solution provided here: https://xrmtinymce.codeplex.com/

    ReplyDelete
  4. Hi,

    I am using this plugin to replace default email editor of CRM but when i click send email. It doesn't copy text from this email editor, CRM is still test from description field of CRM form.
    Can anybody please help.

    ReplyDelete
  5. Hi,
    Can i put content in textarea using scripts..??

    ReplyDelete
  6. Thank you for sharing any good knowledge and thanks for fantastic efforts
    afssac
    fire fighting academy
    Firefighter I *
    Arsisc

    ReplyDelete
  7. Sharing knowledge with people is a very good thing , thanks for any good knowledge you shared in this blog
    real estate
    cars
    Jobs

    ReplyDelete
  8. its really nice article,
    Thanks for the wonderful information .Free text to HTML converter
    Keep sharing

    ReplyDelete
  9. Any full code for this please? I really need it.

    ReplyDelete
  10. Is there a full installation description available? I miss some vital information to get this running. Many thanks upfront!

    ReplyDelete
  11. A Plain Text Editor
    Plain Text files
    That's right, if you're writer on a budget, you don't need to spend any money buying expensive writing software or apps. Instead, you can use the text editor that comes free with your operating system.
    Just open up Notepad on Windows or TextEdit on a Mac. I like plain text editors for writing something short quickly and easily, without thinking much about it. I wrote a blog post about the benefits of using plain text editors as writing software.
    Use for: writing whatever, wherever

    ReplyDelete
  12. A Plain Text Editor
    Plain Text files
    That's right, if you're writer on a budget, you don't need to spend any money buying expensive writing software or apps. Instead, you can use the text editor that comes free with your operating system.
    Just open up Notepad on Windows or TextEdit on a Mac. I like plain text editors for writing something short quickly and easily, without thinking much about it. I wrote a blog post about the benefits of using plain text editors as writing software.
    Use for: writing whatever, wherever

    ReplyDelete
  13. The Best of the Blogs You have Mentioned here. Thanks for sharing.
    Microsoft Dynamics AX Online Training

    ReplyDelete
  14. Amazing explained about Rich text editor JavaScript. Thank you for sharing.

    ReplyDelete
  15. Thank you for sharing information on Rich text editor JavaScript. regularly follow your blog. keep sharing on.

    ReplyDelete
  16. Very informative post. Thanks for this posting about Rich text editor JavaScript.

    ReplyDelete

My Name is..