I am trying to use the javascript filters in Forms 10.4.2.381, and am looking to assign a task always to the supervisor, unless they completed a previous step. If so, assign it to a different person.
The scenario is the Payment Services team has the task assigned to them for processing. It then goes to another step for verification, assigning again to the Payment Services Team, excluding the person who did the processing, using a filter. (This part works fine)
We're looking to escalate this Verification step to the manager within a certain period of time. The catch is if the manager had to do the initial processing, we'd like to have it escalate to a different, specified person. (We'll call them Employee A)
Using the following filter, it properly assigns to one or the other. (The Manager or Employee A) If either was the processor, but if I have a different person as the processor (Employee B), it returns both the Manager and Employee A. We're looking to have it return the manager only, unless they were the processor.
var Manager = team.findMembersByRole('Payment Services Assistant Manager'); var ProcessedBy = team.findTeamMembersByDisplayName($util.getValue('Processed_By')); if (Manager = ProcessedBy) { var EscalationTeam = team.findMembersByRole('Internal Funds Transfer Verification Escalation'); var Exclude = team.findTeamMembersByDisplayName($util.getValue('Processed_By')); $result = $util.difference(EscalationTeam, Exclude); } else { $result = Manager; }
If helpful, the manager is the only person with the role of 'Payment Services Assistant Manager'. Also, the manager and Employee A are the only two people with the role 'Internal Funds Transfer Verification Escalation'.
As for the javascript, it looks like it keeps evaluating the IF condition as true, when it shouldn't, assuming I've done it correct.
Thanks