ChildRelationship Class
Contains methods for accessing the child relationship as well as the child sObject for a parent sObject.
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.
-
Returns the token of the child sObject on which there is a foreign key back to the parent sObject.
-
Returns the token of the field that has a foreign key back to the parent sObject.
-
Returns the name of the relationship.
-
Returns
trueif the child object is deleted when the parent object is deleted,falseotherwise. -
Reserved for future use.
-
Returns
trueif the parent object can’t be deleted because it is referenced by a child object,falseotherwise.
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