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
Mysti, Developer DocumentationMysti, Developer Documentation 

How can an admin prepopulate a Long Text Area field?

A customer question I can't answer. Can anyone help?

 

I'd like to prepopulate some fields when we create new cases. I've come across a few ways to do that for simple standard fields and for custom fields, but one of the fields that I want to work with is a Long Text Area, and those seem to be more difficult. Is there a recommended way to prepopulate a Long Text Area field? Is it possible to do it by pulling in the text from an object somewhere, such as the contents of a Content record, or perhaps a static resource?

 

thanks!

 

Mysti

AdrianCCAdrianCC

Hello,

 

Go to Setup> Create> Custom Objects> your object and select edit on the Long Text Area field. There's a Default Value field where you can specify what value to have upon creation.

You can also set the initial value with a Workflow Rule, just for the case when the record is first created. 

Another way would be as you've said to copy that value from somewhere else.  For this you'll need a trigger. I don't know if you can use a Custom Setting for this, it depends on how big do you want the initial text to be; from what I remember you can only add Text(255 chars) fields to a custom setting, so no long text areas.

 

Regards,

Adrian 

StephenNStephenN

Thanks AdrianCC -- that worked great! I hadn't realized that a custom Long Text Area field could have default text. Since the standard case field can't, I hadn't even bothered to try a custom version. This will really help me move my project along.

Steve