You need to sign in to do that
Don't have an account?
Urvik
Abbreviate Long Text Area and display with ellipses
I have a field with data type long text area. I am displaying it on visualforce page. But I want to allow that field to display only first 200 characters and end it with ellipses (.....). Someone please help.
You are using standard controller or extension or custom controller.
If you are using extension or custom controller then please use following solution.
I am taking Contact as example and consider, I have custom field discription__c on it. then use following code.
Contact con = [Select Id, description__c from Contact Limit 1];
if(con.description__c.lenght() > 200){
con.description__c = con.subString(0,200)+'(...)';
}
Thanks,
Gajanan