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
Vijay NagarathinamVijay Nagarathinam 

round robin logic

Hi,

I want to assign the owner based on the round robin logic. I have used one custom object based on the condition the owner will be assigned dynamically. I have used record like below.

Campus    User
C1             U1
C1             U2
C2             U1
C2             U2

If the campus as C1 the record will be assigned to U1 and next time assigned to U2. Similarly, it will work for remaining campus. Please help me how to achieve this.

Thanks,
Vijay
NagendraNagendra (Salesforce Developers) 
Hi Vijay,

Please find the blog below which helps you attaining the above requirement.
https://success.salesforce.com/ideaView?id=087300000006tuZ

Hope this helps.

Best Regards,
Nagendra.P
Vijay NagarathinamVijay Nagarathinam
Hi Nagendra,

In that blog, they are using custom application for round robin logic. I need to  implement this logic using apex instead of custom application in app exchange.

Thanks,
Vijay
Narveer SinghNarveer Singh
Hi Vijay,

You can use 

MOD(VALUE(Lead_Number__c), 3) formula to calculate result and by using below condition use can use in your code :

Round_Robin_ID = 0 is assigned to Queue A
Round_Robin_ID = 1 is assigned to Queue B
Round_Robin_ID = 2 is assigned to Queue C

For More details can you please have a look on : 

https://yashi.com/blog/how-implement-round-robin-record-assignment-application-salesforce
https://help.salesforce.com/apex/HTViewSolution?id=000004000

Hope this helps you!

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution.Let me know if anything else.

Best Regards
Narveer
 
m pandeym pandey
hi Vijay Nagarathinam

i need u r  help......
https://developer.salesforce.com/forums/?id=906F0000000AxfCIAS 
as u have shown code for above link for  parent to child when we will select  for the parent to child
bt i need the select for all  where i check the check  all accounts should be selected and all contacts child should be shown in vf page....?
please let me get the code pleasee....