We have a requirement that we should display running lines in Case comments , instead of a standard one.

Am planning to Copy Rich Text field (Case Comments) values to another rich text field values to display the running lines.

Below is my code:

trigger CEP_Case_Comment_Trigger on CEP_Case_Comments__c (before insert, before update) {

    for(CEP_Case_Comments__c caseComm :trigger.new){
        caseComm.CEP_Case_Comments_Formula__c = '<marquee>'+ '<B>'+ caseComm.CEP_Case_Comments__c  + '<B>'+'</marquee>';

        caseComm.CEP_Case_Comments_Formula_Text__c =  '<marquee>'+ '<B>' + caseComm.Case_Comments_Formula_Text_Area__c  + '<B>'+ '</marquee>';  

The HTML Tag <marquee> is not working with Trigger, but the tag <B> is working. Please help.

  • Can you please shade some more light on "working and not working" tags. Are they saved in the system? Generating error during parsing or runtime? – Mahmood Jan 5 '18 at 13:43
  • Hello Mahmood, am using only <marquee> and <B> tag. Yes am using in Trigger. No error is generating. Am not getting the running lines. – razor Jan 5 '18 at 13:57

Rich text fields only support a very limited subset of all html tags. Marquee is not one of them. Unsupported tags are automatically deleted. You can find the full list of supported tags here: https://help.salesforce.com/articleView?id=fields_using_html_editor.htm&type=5

As a side note, the marquee tag has been marked obsolete, so you may wish to stop using it where possible: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/marquee

  • 1
    I do not miss the marquee-laden early 2000's of the Internet. – sfdcfox Jan 5 '18 at 15:03
  • @sfdcfox hahaaha. I had to look it up to remind me what it does. I might start using it again for the nostalgic value. They were simpler (and uglier times). – Kasper Jan 5 '18 at 15:41
  • CSS animations rendered marquee obsolete. I'm not even sure modern browsers would do anything other than treat it as a normal span element. – sfdcfox Jan 5 '18 at 15:48
  • 1
    @sfdcfox It still works in Chrome! And after having looked at it for a minute my nostalgia has vanished.... – Kasper Jan 5 '18 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.