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
Masahiro KawataMasahiro Kawata 

How do I adjust the number of characters in a rendered outputField?

I have an outputField that will take in solid, unbroken lines of characters that cannot be modified. I want to display them on my page, but they can be very long - this messes up the page formatting. Is there some way of getting the outputField to render only the first 50 or so characters but still store the rest?

The datatype is 'Text Area (long)'.

Thank you.
Pankaj_GanwaniPankaj_Ganwani
Hi,

You can use LEFT(text, num_chars) visualforce funtion to display the string upto first 50 characters. Example: LEFT(fieldName, 50). Not sure if it will be working with outputField. If it won't, then use <apex:outputText> instead.
Masahiro KawataMasahiro Kawata
So it turns out I'm an idiot - just needed to use outputLink, which can handle enormous URLs while rendering as a compact label.

Thank you for your help Pankaj.