FieldSetMember Class

Contains methods for accessing the metadata for field set member fields.

Schema

Use the methods in the Schema.FieldSetMember class to get details about fields contained within a field set, such as the field label, type, a dynamic SOQL-ready field path, and so on. The following example shows how to get a collection of field set member describe result objects for a specific field set on an sObject:

If you know the name of the field set in advance, you can access its fields more directly using an explicit reference to the field set:

See Also

The following are methods for FieldSetMember. All are instance methods.

  • getDBRequired()

    Returns true if the field is required by the field’s definition in its sObject, otherwise, false.

  • getFieldPath()

    Returns a field path string in a format ready to be used in a dynamic SOQL query.

  • getLabel()

    Returns the text label that’s displayed next to the field in the Salesforce user interface.

  • getRequired()

    Returns true if the field is required by the field set, otherwise, false.

  • getType()

    Returns the field’s Apex data type.

  • getSObjectField()

    Returns the token for this field.

Returns true if the field is required by the field’s definition in its sObject, otherwise, false.

public Boolean getDBRequired()

Type: Boolean

Returns a field path string in a format ready to be used in a dynamic SOQL query.

public String getFieldPath()

Type: String

See Displaying a Field Set on a Visualforce Page for an example of how to use this method.

Returns the text label that’s displayed next to the field in the Salesforce user interface.

public String getLabel()

Type: String

Returns true if the field is required by the field set, otherwise, false.

public Boolean getRequired()

Type: Boolean

Returns the field’s Apex data type.

public Schema.DisplayType getType()

Type: Schema.DisplayType

Returns the token for this field.

public Schema.sObjectField getSObjectField()

Type: Schema.SObjectField