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
Big EarsBig Ears 

Unable to set some fields in field sets as required

Is anybody aware of the rules behind field sets, with regards to which fields can be set as required and which cannot? I've created some field sets that get referenced by a dropdown in a visualforce page. That way, users can quickly switch between different groupings of fields.

However, the admin interface won't let me set some of the fields to  "required" within the field set. These aren't all the same type of field (some are drop-downs, others are not) and in some cases, the same field in different fields sets can be set to "Required" in one and not the other.

Does anybody have any idea what could cause this?
Best Answer chosen by Big Ears
Big EarsBig Ears

Just to follow up here:

There was a simple workaround. Deploying field sets between orgs caused the fields included in the field sets to "lock" their attributes. Removing and re-adding the fields cleared the lockout, meaning that we could update their "Required" attribute as desired.

All Answers

Big EarsBig Ears
Also - I've got the same field sets in different sandboxes - In one of the sandboxes, I can mark the fields as required. In others, I cannot......
Ashish_SFDCAshish_SFDC
Hi , 


Please see the documenation below,

DBRequired Indicates whether the field is required for the object

Required Indicates whether the field is required in the field set

http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_field_sets.htm

To make a field required, double click the element or click the wrench icon (Wrench icon) next to it and select the Required checkbox.
Note
Missing Value in Field icon―Indicates the field is required and must have a value to save the record.

https://help.salesforce.com/htviewhelpdoc?id=fields_editing_field_sets.htm&siteLang=en_US

https://help.salesforce.com/HTViewHelpDoc?id=fields_required_field_sets.htm&language=en_US

isRequired boolean Read-only. Indicates whether the field is universally required (true) or not (false).

http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_fieldset.htm

https://developer.salesforce.com/forums/ForumsMain?id=906F000000097HyIAI

Reply back if you have any further questions. 


Regards,
Ashish


Big EarsBig Ears
Unfortunately, these don't answer my question. To clarify, the problem is as follows:
  • • In some cases, the "required" attribute is greyed out when setting up a field set, although there doesn't seem to be a reason as to why
  • • In some cases, I have the same field in different field sets, and the behaviour is different in different field sets
  • • In some cases, I have the same field set in different sandboxes and the behaviour is different across the orgs
I've ended up re-creating the field sets in my production org and that has fixed it. However, are there rules in what happens to field sets when they are deployed between orgs. These aren't part of managed packages (I created them), but they were included in change sets.
Ashish_SFDCAshish_SFDC
Hi, 

There can be a couple of reasons, 

We might have to further look into the below details, 

- If the field is a formula field or a reference field. 

- Understanding the Record Types and Page Layout and checking how the field is displayed. 

- last, the field properties in the Object level description. 

There has to be some difference which has to be investigated about the different behavior in seperate sandboxes. 

If you believe that there is absolutely no difference then, log a case with Support, they will further investigate. 

Regards,
Ashish
Ashish_SFDCAshish_SFDC
Hi Big Ear, 

See the article below, 

Field Sets Required Bit
Available in: Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions

Note
This release contains a beta version of field sets that is production-quality but has known limitations.
You can define a field as required when you create or edit field sets. You may want to define a field as required to ensure a user enters the necessary information on a field. The required field is only available in the In the Field Set container. If you define a field as required in the In the Field Set container, and remove the field from the In the Field Set, the required attribute is removed.
To define a field as required in a field set, see Creating and Editing Field Sets

https://help.salesforce.com/apex/HTViewHelpDoc?id=fields_required_field_sets.htm&language=en_US

Regards,
Ashish
Big EarsBig Ears

Ashish,

Thank you for the time you've spent on this. Unfortunately, the behaviour isn't apparent from the documentation. I've raised a case with Salesforce and will follow up back here with the response.

With thanks,
Andy

Big EarsBig Ears

Just to follow up here:

There was a simple workaround. Deploying field sets between orgs caused the fields included in the field sets to "lock" their attributes. Removing and re-adding the fields cleared the lockout, meaning that we could update their "Required" attribute as desired.

This was selected as the best answer