Suppose to have an approval process where the approver of a step is a related user designated through a custom field. If the value of the custom field is changed, all the records in this approval step are unaffected. Of course, in some cases this is the desired behaviour but in some cases it can be not. It is possible to automatically reassign the approvers of these records to the new related users (maybe through a trigger)?
I'm working on something that involves the strategy proposed in this question. However, I've some problems in the SOQL. I need to select from
processInstanceWorkItem the records but since the
ProcessInstance can be anything, it gives me errors when I try to reference the records fields.