You need to sign in to do that
Don't have an account?
Anand Prakash Tiwari
Hierarchy Constraint Violation not working for Child record
I am having a lookup field for the same object (self lookup)
As per salesforce, we should receive following error if any record tries to make self as a parent or tries to choose any of the child record as a parent.
Hierarchy Constraint Violation
You cannot set a hierarchy field Parent Hotel to point to itself or a child record.
But, I am not getting this error if I am making a circular hierarchy, as described below -
1. If making same record as parent of any record (record parent of self during edit) , A->A. then getting thsi error. This is good.
2. If A -> B->A, then It is not giving error.
Could you please help, if there is any configuration for enabling to restrict circular dependency from clild?
Regards,
Anand
As per salesforce, we should receive following error if any record tries to make self as a parent or tries to choose any of the child record as a parent.
Hierarchy Constraint Violation
You cannot set a hierarchy field Parent Hotel to point to itself or a child record.
But, I am not getting this error if I am making a circular hierarchy, as described below -
1. If making same record as parent of any record (record parent of self during edit) , A->A. then getting thsi error. This is good.
2. If A -> B->A, then It is not giving error.
Could you please help, if there is any configuration for enabling to restrict circular dependency from clild?
Regards,
Anand
As explained in the h&T doc:
Self Relationships
You can create a relationship from an object to itself, but it must be a lookup relationship, and a single record can't be linked to itself. However, a record can indirectly relate to itself. For example, the Holiday Promotion campaign can have the Direct Mail campaign selected in the lookup relationship, and the Direct Mail campaign can have the Holiday Promotion campaign selected in the lookup relationship.
You can't create a many-to-many self relationship, that is, the two master-detail relationships on the junction object can't have the same master object.
So for custom objects - such elf lookup will not give you an error, however, the error is applicable for the standard Parent Account field on Account
reference: http://help.salesforce.com/HTViewHelpDoc?id=relationships_considerations.htm&language=en_U