FieldSet

Represents a field set. A field set is a grouping of fields. For example, you could have a field set that contains fields describing a user’s first name, middle name, last name, and business title.

Field sets can be referenced on Visualforce pages dynamically. If the page is added to a managed package, administrators can add, remove, or reorder fields in a field set to modify the fields presented on the Visualforce page without modifying any code.

Parent Type 

This type extends Metadata and inherits its fields.

Version 

Introduced in API version 21.0.

Fields 

availableFields 

  • Type: FieldSetItem[]
  • Required: No
  • Description: An array containing all the possible fields in the field set.

description 

  • Type: string
  • Required: Yes
  • Description: Required. A description provided by the developer that describes the field set. This is required.

displayedFields 

  • Type: FieldSetItem[]
  • Required: No
  • Description: An array containing all the fields that are presented on the Visualforce page. The order in which a field is listed determines the order of appearance on the page.

label 

  • Type: string
  • Required: Yes
  • Description: Required. The label used to reference the field set.

FieldSetItem Type 

FieldSetItem represents an individual field in a field set.

Fields 

alternativeDisplayFormat 

  • Type: string
  • Required: No

field 

  • Type: string
  • Required: No
  • Description: Required. The name of a field in a standard or custom object.

isFieldManaged 

  • Type: boolean
  • Required: No
  • Description: Read-only. Denotes whether the field was added to the field set via a managed or unmanaged package.

isRequired 

  • Type: boolean
  • Required: No
  • Description: Read-only. Indicates whether the field is universally required (true) or not (false).

Declarative Metadata Sample Definition 

A sample XML definition of a FieldSet component is shown below.

1<?xml version="1.0" encoding="UTF-8"?>
2<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
3    <fieldSets>
4        <fullName>FieldSetNames</fullName>
5        <availableFields>
6            <field>MiddleName__c</field>
7        </availableFields>
8        <availableFields>
9            <field>Title__c</field>
10        </availableFields>
11        <description>FieldSet containing how to properly address someone</description>
12        <displayedFields>
13            <field>FirstName__c</field>
14        </displayedFields>
15        <displayedFields>
16            <field>LastName__c</field>
17        </displayedFields>
18        <label>FieldSet Names</label>
19    </fieldSets>
20</CustomObject>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.