Need help in solving this problem -
I have a BO Employee containing list of employees of my client. As usual, each employee has a manager which is a reference to another Employee in the same BO. (Employee in EMPLOYEE BO reports to Manager in EMPLOYEE BO).
In the application, Manager should be able to select his direct reports and change their Manager field to himself.
Manager logs in --> Process initiated --> PICK ONE OR MORE query runs and shows all employees minus the Manager employee --> Manager selects 1 or more employees --> For each of these employees, process updates the respective manager field with the reference to the LoggedIn Manager. --> A different query shows all the employees reporting to this manager.
This works well EXCEPT
The process updates the Manager field of the LoggedIn Manager himself to his own ID (which is not desired as the manager reports into someone else).
Can someone please help me with this? The only way I am able to explain this is that the original Employee was already in the Context and the PICK one or more query only appended other (selected) employees to context.
Thanks