function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SabrentSabrent 

Assign lead to user with least number of open leads

I have created a web to lead form, and want the lead to be assigned to the user with the least number of open leads. 

I am not sure Omni Channel would work for this use case, becuase this is not a service desk.  

I was thinking of creating  custom field on the User object that would keep a count of the number of open leads owned by the User, and then writing  BEFORE (INSERT OR UPDATE) trigger. 
 

Does anyone have a better solution or recommendation ?