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
kgkrishnan kgkrishnankgkrishnan kgkrishnan 

In lightning interface set maxlength = 5000 for OOTB "Description" field of Contact/Case Objects.

Hi Lightning Experts,

For Contact/Case objects, in OOTB Lightning  Record Details Page,  I need to limit field "Description" [OOTB (Standard field )] to only 5000 characters. Being a LongTextArea type, it allows 32000 characters as default behaviour.

Using Validation Rule I can do it. However the issue is, I want the UX to stop user typing 5001 th character.  Not that a rule flags error ONLY while trying to save entire page changes. As there might  be 2-3  more such fields with same behavioural requirement.

Also aware that being Lightning, any JQuery/ JS is discouraged due to clash with Locker Service.  So, any thoughts how to achieve it? With or without JQuery?
Raj VakatiRaj Vakati
I dnt think so its an easy work ..  
Insted of Standard Description create a new Description long text area with 5000 .. 
Or use validation rule as you said .. 
kgkrishnan kgkrishnankgkrishnan kgkrishnan
Thanks Raj. Wow, thats a different way to solve it.
Raj VakatiRaj Vakati
Mark it as solved ! 
kgkrishnan kgkrishnankgkrishnan kgkrishnan
Sure. Will wait for a day or two to get any more suggestions. Thanks Raj.