9

Here is the snapshot for a "Text Area" field, notice that the "required" attribute is available i.e. we can set this field as required:

enter image description here

Here is another snapshot for a "Long Text Area" field, notice that the required attribute is missing on this screen: enter image description here

Do you know if this is intentional? If so, where is this documented? (I tried but couldn't find anything related to this)

The issue is, we had a "Text Area" field in sandbox which was set as "required". Due to a new requirement, this field was updated to "Long Text Area" (we didnt notice the missing "required" attribute when the datatype was changed). Apparently, the deployment of this field to PROD org failed coz the field was marked as required in the PROD org however it was set as "not required" (note we didnt change any attribute we just changed the datatype) in the sandbox.

Eventually, we had to uncheck the required flag in PROD and then migrate the field.

Wondering if this is a known limitation? Or is there another way to set the fields of type "Long Text Area" as required when they are created?

10

For some reason, Salesforce does not allow you to make a number of types required. It's no use asking why.

Workaround: make a validation rule that checks whether this field is filled.

  • 1
    Did someone already documented list of types which can be set as required and the ones which cannot during field creation process? My only concern was that it adds an overhead to the migration...guess will have to live with the workaround. – Rajiv Bhatt Apr 22 '15 at 17:14
3

The long text area required attribute is missing while creating the field but you can set the field as required from the page layout by clicking on the wrench icon and checking the required attribute.

  • Unfortunately, the page layout "Required" does not seem to influence Lightning Components lightning:inputField display/usage :( – Sam Whitmore May 2 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.