function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Robert Webber 6Robert Webber 6 

Assign approver from related list

This is something that should be simple but I'm stuck. I am trying to assign an approval to a related user. Object1 has a lookup to Object2. I want to use the Owner of Object2 as the approver when I kick of the approval from Apex. I have tried creating a hierarchical field on the User object called "PLOwner__c", and I assign it to the Owner.ID of Object2 when a submit button is clicked. I get the error:

first error: CIRCULAR_DEPENDENCY, attempt to violate hierarchy constraints: [plowner__c]

Is there an easy way to assign the owner of a related record as next approver from Apex? The Salesforce documentation is confusing.

Bob

 
AnudeepAnudeep (Salesforce Developers) 
A similar issue is described here. You might want to take a look