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
theitdeptrockstheitdeptrocks 

ISNULL, ISBLANK, NOT <> "" for a Rich Text field

Hi all,


I am having a problem with rich text fields on my VF page.  If the rich text field has a value in it, I want to display the language, "below." and if it does not contain a value I want to display the language, "in the attached spreadsheet."

 

 

{!IF(not(Administrative_Task__c.Compensation_Term_Date_Data_Rich__c=""), 'below.','in the attached spreadsheet.')} 

 When I leave the field blank and refresh the VF page, the "below" language is used.  When I fill in the field, save the record, and refresh the VF page, the "below" language is still used correctly.

 

Then I tried the NOT(ISNULL( approach:

 

{!IF(NOT(ISBLANK(Administrative_Task__c.Compensation_Term_Date_Data_Rich__c)), 'below.','in the attached spreadsheet.')}  

 

 

With the field blank, it used the "below" language.  With the field populated, it still displayed "below," but it should have in this scenario.

 

Lastly I tried the NOT(ISNULL( approach:

 

{!IF(NOT(ISNULL(Administrative_Task__c.Compensation_Term_Date_Data_Rich__c)), 'below.','in the attached spreadsheet.')}  

 

 

Same results as above.

 

 

Does anyone have a way to solve this?

 

Thanks in advance!

theitdeptrockstheitdeptrocks

I couldn't find a coding solution that worked, but I did come up with a workaround that is working fine. 

 

The work around includes an additional checkbox field and two workflow rules with field update actions.  The first rule sets the checkbox to true when there is a value in the rich text field.  The second sets the checkbox to false when the rich text field is blank.  Then:

{!checkboxfield=true,'below.','in the attached spreadsheet.')}
sravusravu

Try the following and see if it works.

 

{! IF((Administrative_Task__c.Compensation_Term_Date_Data_Rich__c! =NULL), 'below.','in the attached spreadsheet.')}