ChildRelationship Class

Contains methods for accessing the child relationship as well as the child sObject for a parent sObject.

Schema

A ChildRelationship object is returned from the sObject describe result using the getChildRelationship method. For example:

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

  • getChildSObject()

    Returns the token of the child sObject on which there is a foreign key back to the parent sObject.

  • getField()

    Returns the token of the field that has a foreign key back to the parent sObject.

  • getRelationshipName()

    Returns the name of the relationship.

  • isCascadeDelete()

    Returns true if the child object is deleted when the parent object is deleted, false otherwise.

  • isDeprecatedAndHidden()

    Reserved for future use.

  • isRestrictedDelete()

    Returns true if the parent object can’t be deleted because it is referenced by a child object, false otherwise.

Returns the token of the child sObject on which there is a foreign key back to the parent sObject.

public Schema.SObjectType getChildSObject()

Type: Schema.SObjectType

Returns the token of the field that has a foreign key back to the parent sObject.

public Schema.SObjectField getField()

Type: Schema.SObjectField

Returns the name of the relationship.

public String getRelationshipName()

Type: String

Returns true if the child object is deleted when the parent object is deleted, false otherwise.

public Boolean isCascadeDelete()

Type: Boolean

Reserved for future use.

public Boolean isDeprecatedAndHidden()

Type: Boolean

Returns true if the parent object can’t be deleted because it is referenced by a child object, false otherwise.

public Boolean isRestrictedDelete()

Type: Boolean