Reply
Regular Contributor
CloudConversion
Posts: 77
Accepted Solution

Using the New "Rich Text Area" Data Type in VisualForce?

We're trying to use the new "Rich Text Area" Data Type in our VisualForce pages, but getting the following error:

 

"Error: Invalid field Main_Content__c for SObject CloudConversion__Portal_Content__c"

 

This is supported yet?  Is there a special trick to get it to work?

 

Thanks,

Jon 

 

 

<apex:outputText escape="false" value="{!content.Main_Content__c}"/>

 

 

 

Super Contributor
TehNrd
Posts: 1,725

Re: Using the New "Rich Text Area" Data Type in VisualForce?

What about:

 

<apex:outputField value="{!content.Main_Content__c}"/>

 

Is the instance on Spring 10?

Regular Contributor
CloudConversion
Posts: 77

Re: Using the New "Rich Text Area" Data Type in VisualForce?

Nope, get the same error.  Yes, this is Spring '10 with the new Rich Text Area field.

 

Thanks,

Jon 

Super Contributor
TehNrd
Posts: 1,725

Re: Using the New "Rich Text Area" Data Type in VisualForce?

Only other thing I can think if is that this field, "Main_Content__c" doesn't exist on this object "CloudConversion__Portal_Content__c" as this is what the messages is saying.

 

If your positive it exists and spelling is correct you may need to reach out to salesforce support.

Super Contributor
BritishBoyinDC
Posts: 576

Re: Using the New "Rich Text Area" Data Type in VisualForce?

[ Edited ]

"<apex:outputfield"

 

Hmm, odd - the tag above works for me with a Rich Text field using a simple page with a standard controller for a custom object. Works on both an internal VF page and an external Sites page...

 

 

 However, if I try and change the API version of the page to 17.0, I get the same error - so check that the API version page is also set to 18.0

 

Message Edited by BritishBoyinDC on 02-12-2010 04:50 PM
Message Edited by BritishBoyinDC on 02-12-2010 04:52 PM
www.bridgefarmconsulting.com
http://twitter.com/britishboyindc
Regular Contributor
CloudConversion
Posts: 77

Re: Using the New "Rich Text Area" Data Type in VisualForce?

Hmm, strange.  We are trying to use it on a Salesforce site with a custom controller, but it won't even allow me to save the VisualForce page with the Rich Text field in it...  
Super Contributor
BritishBoyinDC
Posts: 576

Re: Using the New "Rich Text Area" Data Type in VisualForce?

Change the API version of the Page to 18.0
www.bridgefarmconsulting.com
http://twitter.com/britishboyindc
Regular Contributor
CloudConversion
Posts: 77

Re: Using the New "Rich Text Area" Data Type in VisualForce?

Yes, I already did that on both the Apex class and the VF page, but still getting the "Error: Invalid field Main_Content__c for SObject CloudConversion__Portal_Content__c" error when I try to save the VF page...
Super Contributor
BritishBoyinDC
Posts: 576

Re: Using the New "Rich Text Area" Data Type in VisualForce?

If you create a new page with the standard controller, does it work?
www.bridgefarmconsulting.com
http://twitter.com/britishboyindc
Regular Contributor
CloudConversion
Posts: 77

Re: Using the New "Rich Text Area" Data Type in VisualForce?

Ok, thanks for all your help!  I figured out a workaround, but I believe this is a bug.

 

Apparently, the <apex:composition> and <apex:define> don't play nice with the new Rich Text fields.

 

So, we've just changed the <apex:insert> to instead be a component.

 

Thanks,

Jon