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
ForceLoverForceLover 

Issue related to lead queues

Hi,

 

I need your suggestions on this issue

 

1) I have 10 leads on a lead queue for example numbered as 1,2,3,4,5,6,7,8,9,10.while follow up, the lead3 is not responded say went to voice mail, then the lead3 should come in an order in the queue like 4,5,6,7,8,9,10,3

 

How i can achieve this...

JayNicJayNic

If you've got a "QueuePriority__c" field that denotes the sort order, then it's a matter of:

 

1)  Finding all Leads where the QueuePriority__c is greater than the current record (egL if your priority is 3, then you need to query for "WHERE QueuePriority__c > 3"

2) Looping through that result set, and subtracting one from each of those Priorities to move them up in the queue

3) At the end of that loop, grab the leads QueuePriority and assign that number to your Lead in question

4) add all leads to a single list: update