I'm a young Apex developer. I have a quick question:
I would like to dynamically assign new records to users using an Apex trigger. As we know, every new created records are automatically assigned to the current logged in user.
I am trying to create a trigger that assigns the leads between the 2 users equally. The solution should count the number of leads assigned to each user, so that we have similar number of leads assigned to each user.
For example: - You have User C and User D - You mass insert 7 lead records - Leads 1, 3, 5 and 7 are assigned to User C - Leads 2, 4 and 6 are assigned to User B