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
Mustafa Khan 12Mustafa Khan 12 

Formula field(number) If statement with recordtype, checkbox and MOD

Hi,
I'm trying to create a Round Robin and are almost done i need help with one formula. I need to add a checkbox__c is true or a picklist value is <> "Value" to the formula under. I want it to loop 1,2,3 only when recordtype "US_Request_a_Quote" and if checkbox__c is true or a picklist value is not equal to ""

IF( RecordType.Name = "US_Request_a_Quote", 
MOD(VALUE(Round_Robin_Opportunity__c) ,3) +1, 
NULL)
Raj VakatiRaj Vakati
Try this
 
IF(
AND( RecordType.Name = "US_Request_a_Quote", 
checkbox__c =true , 
Text(picklist__c)<>'value'),
MOD(VALUE(Round_Robin_Opportunity__c) ,3) +1, 
NULL)

 
Mustafa Khan 12Mustafa Khan 12
Hi Raj,
It worked :) Thank you so much.
I have a new problem now. When the Round Robin is at 1 and the next time the IF statement is not TRUE then it shows blank, but the when the 2nd time it is true and should show 2 it shows 3. Is there something i can do different?
 
Raj VakatiRaj Vakati
Can you explan more .. 
Raj VakatiRaj Vakati
Add one more if conditions like below
 
IF(
IF(MOD(VALUE(Round_Robin_Opportunity__c) ,3)==1 , 
1 ,
AND( RecordType.Name = "US_Request_a_Quote", 
checkbox__c =true , 
Text(picklist__c)<>'value'),
MOD(VALUE(Round_Robin_Opportunity__c) ,3) +1, 
NULL)
)

 
Mustafa Khan 12Mustafa Khan 12
Scenario:
1. First Opportunity comes in and Round Robin is at 1 and assigned to a user.
2. A 2nd Opportunity comes in but the picklist value is not true so the Round Robin formula field return blank
3. The 3rd time an Opportunity comes in and the IF statement is true, but it gives me 3 instead of 2.

Will this work?
1IF(
2IF(MOD(VALUE(Round_Robin_Opportunity__c) ,3)==1 ,
31 ,
4AND( RecordType.Name = "US_Request_a_Quote",
5checkbox__c =true ,
6Text(picklist__c)<>'value'),
7MOD(VALUE(Round_Robin_Opportunity__c) ,3) +1,
8NULL)
9)
Mustafa Khan 12Mustafa Khan 12
Scenario:
1. First Opportunity comes in and Round Robin Formula is met and gives it number 1 and assigned to a user.
2. A 2nd Opportunity comes in but the picklist value is not true so the Round Robin formula field return blank
3. The 3rd time an Opportunity comes in and Round Robin Formula field is met, but it gives me 3 instead of 2.

Will this work?
1IF(
2IF(MOD(VALUE(Round_Robin_Opportunity__c) ,3)==1 ,
31 ,
4AND( RecordType.Name = "US_Request_a_Quote",
5checkbox__c =true ,
6Text(picklist__c)<>'value'),
7MOD(VALUE(Round_Robin_Opportunity__c) ,3) +1,
8NULL)
9)
Raj VakatiRaj Vakati
Ye.. that will work 
Mustafa Khan 12Mustafa Khan 12
Appreciate all the help.

I got  Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 5
i don't need checkbox__c =true
edralphedralph
An option if you don't want to maintain your own code is SuperRoundRobin on the AppExchange.  It supports Lead, Opportunity, Case, Account and any other standard or custom object:

https://superroundrobin.com
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FR4MkUAL