function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BrandiTBrandiT 

Rich Text Area Workflow Formula - Merge Fields not Working

I have a rich area text field called advice_lines__c, which should pre-populate with some standard text and formatting.  I found out that you cannot set default text in a rich area text field.  So I created a workflow rule to add the default text after the record is created which works fine for my purposes.

 

In the workflow rule, I use this in the formula area of the field update which adds the text and formats it:

 

"<div align=center><b>APRVD NON-STANDARD</b> </div><br><div align=left><ul><li>Second Advice Line is Mandatory. Please enter advice lines exactly as shown above in bold.</li> <li>Incentive Advice Line must be on a separate permanent advice line with an 'A' in the SP INS field and must appear directly below the item code on non-art items and below the Art ID line on art items. </li> <li>Only one discount is allowed per item.</li></ul><div>"

 

Now I need to add a line to this default text that pulls a value from another field called NS_Auto_Number__c.  When I use the formula editor to add the merge field, it doesn't pull the information from the field.  Instead it just shows the field name.

 

Here is my formula after I add the merge field info:

 

"<div align=center><b>APRVD NON-STANDARD</b><br>{!NS_Auto_Number} </div><br><div align=left><ul><li>Second Advice Line is Mandatory. Please enter advice lines exactly as shown above in bold.</li> <li>Incentive Advice Line must be on a separate permanent advice line with an 'A' in the SP INS field and must appear directly below the item code on non-art items and below the Art ID line on art items. </li> <li>Only one discount is allowed per item.</li></ul><div>"

 

Here is the result:

 

APRVD NON-STANDARD
NS_Auto_Number
  • Second Advice Line is Mandatory. Please enter advice lines exactly as shown above in bold.
  • Incentive Advice Line must be on a separate permanent advice line with an 'A' in the SP INS field and must appear directly below the item code on non-art items and below the Art ID line on art items.
  • Only one discount is allowed per item.

Here is what I need it to say:

 

APRVD NON-STANDARD
SFDC00234

  • Second Advice Line is Mandatory. Please enter advice lines exactly as shown above in bold.
  • Incentive Advice Line must be on a separate permanent advice line with an 'A' in the SP INS field and must appear directly below the item code on non-art items and below the Art ID line on art items.
  • Only one discount is allowed per item.

 

Is this possible?  Or is there something wrong with the way I'm trying to add it to my workflow formula?

 

Thank you!!

Best Answer chosen by Admin (Salesforce Developers) 
MickleMickle

Try this...it should work. Including values work a little bit different in formula fields than in mail-merge templates.


"<div align=center><b>APRVD NON-STANDARD</b><br>"& NS_Auto_Number &" </div><br><div align=left><ul><li>Second Advice Line is Mandatory. Please enter advice lines exactly as shown above in bold.</li> <li>Incentive Advice Line must be on a separate permanent advice line with an 'A' in the SP INS field and must appear directly below the item code on non-art items and below the Art ID line on art items. </li> <li>Only one discount is allowed per item.</li></ul><div>"

 

If NS_Auto_Number is a custom field, you'll have to end it with __c. Also, if it's of number format, you may need to modify it to be TEXT(NS_Auto_Number__c)