Good day Everyone,
I have a requirement to come up with a either a workflow or plugin to assign custom entity to to team members.
I then choose to use a plugin for the following reason
- We a Business unit
- Under the BU you might have 50 teams
- Each user belonging to the BU ,Has either one or more teams they belong to as well
- The plugin is supposed to get the custom entities ID(eg case)
- Based on the pick lists choose on the custom entities(case) route to the relevant team
- Within each team if you have like 10 member's within team assign to the first one,the next time it comes to the same team it should assign to the next person on the team until all the members are assigned,witohut looping through all members ,me
- Once all members are assigned a case then next time it comes again assigns to the first member within the team.It should then allow for the ability to have a variable holding the last person assigned and the next person to assign to.This should have with all the members of all the teams
My Challenge is then
Assigning from 1 until the 10th member because when I use the for loop and the for each it loops through all the members
// get the option set fields
if (_productcategory != null)
//get the relevant team id
RetrieveAllBUTeams(IOservice, context, ID)
//get the users
entity collection CallUsersFromTeam()
eg foreach(int var c in CallUsersFromTeam.entites)
{
//assign here to the relevant users with the team as discussed above
}
this statement assigns to the first,then to the second until it assigns to the last leading to always the 10th users always ending u with case while the rest of the users do not have as this is the last person on the list.
How can I set up the logic here to cater for this ?