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
Jake BullardJake Bullard 

Queue up leads for a rep to dial from a list of unassigned leads

Hey guys, 

I have an interesting challenge that I'm not sure how to solve. 

We have a group of reps that we would like to queue up calls for. Rather than assigning them out in a round robin fashion we would like to leave all the leads in a queue until such time the rep hits a button to request a lead. At that point they should have exclusivity on the lead and when other people hit the same button a different lead should be displayed for them. 

I first thought to create this in a flow that does a lookup, and then an immediant field update to set the status as "Working". That status will exclude them from the lookup.

Unforuntly if 2 people hit the button at near the same time the flow is too slow and the same lead comes up for both. 


How would you solve this? Would apex code be fast enough to ellivate this concern? If not is there another option I'm not considering?