You need to sign in to do that
Don't have an account?
alexa
How to truncate a textarea field
Hello! I'm new to Salesforce Development. I've been asked to display only the first 250 characters of a field.
If I try
<apex:outputField value="{!LEFT(item.Description,250)}" />
I get the error
Incorrect parameter for function LEFT(). Expected Text, received Object
If I try
<apex:outputText value="{!LEFT(item.Description,250)}" />
I don't get any errors but all of my whitespace is gone, rendering the field unreadable.
item.Description is a textarea.
Any advice is appreciated. Thanks!
Hi Alexa,
Try using s style attribute with either of these and see if you fix the length using that.
I think that should work!
Cool_D
You can also use the attribute escape="false" in your outputText element.
--k