2

In Salesforce there are 3 different Text Area fields:

Text Area, Text Area (Long), and Text Area (Rich).

I'm doing some processing in a custom class and I need to distinguish between the 3 different kinds. My first thought was using Describe but the Schema.DisplayType enum value for all three is simply TextArea.

3

This seems to work for short vs long: http://www.fishofprey.com/2011/03/find-length-of-salesforce-field-in-apex.html

When I test the following in my org:

System.debug(
    Schema.SObjectType.Contact.fields.Description.getLength()
);

I get 32000 back. When I try custom text areas, rich or not, I get the appropriate values back too. Doesn't indicate richness though. For that you can use .Description.isHtmlFormatted() which seems to return TRUE for rich and FALSE for plaintext.

| improve this answer | |

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.