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
Synthia BeauvaisSynthia Beauvais 

Reference Record Type Id in a Formula

How can I reference 2 Record Type ID's in a formula? I have created a Data Quality Score field and a Description field. ​


If the Record Type is "Prospectscore these fields. (Data Quality Score field)
IF(Account.RecordTypeId=(000000000000000000)
IF( ISBLANK( Name),0,0.5)+
IF( ISPICKVAL(Account_Vertical__c,""),0,0.5)+
IF( ISBLANK( MailingStreet ),0, 0.5)+
IF( ISBLANK( MailingCity ),0,0.5)+
IF( ISBLANK( MailingState ),0,0.5)+
IF( ISBLANK( MailingPostalCode ),0,0.5)+
IF( ISBLANK( MailingCountry ),0,0.5)+
IF( ISBLANK( NumberOfEmployees ),0,0.375)+
IF( ISBLANK( DunsNumber),0,0.375)+
IF( ISBLANK(Preferred_Language__c,""),0,0.375)+
IF( ISPICKVAL(Segment_2__c,""),0,0.375)
If the Record Type is "Prospectdescribe these fields. (Description field)
IF(Account.RecordTypeId=(000000000000000000),&
IF( Data_Quality_Score__c =5,"All Contact Details Captured", "Missing: "&
IF( LEN( Name) = 0, "Account Name, ","")&""&
IF( ISPICKVAL(Account_Vertical__c,""), "Account Vertical,","")&""&
IF( LEN( MailingStreet ) = 0, "Street, ","")&""&
IF( LEN( MailingCity ) = 0, "City, ","")&""&
IF( LEN( MailingState ) = 0, "State, ","")&""&
IF( LEN( MailingPostalCode ) = 0, "Postal Code, ","")&""&
IF( LEN( MailingCountry ) = 0, "Country, ","")&""&
IF( LEN( NumberOfEmployees ) = 0, "Number Of Employees, ","")&""&
IF( LEN( DunsNumber) = 0, "    Duns Number, ","")&""&
IF( ISPICKVAL(Preferred_Language__c,""), " Preferred Language,","")&""&
IF( ISPICKVAL(Segment_2__c,""), "Segment,",""))

---------------------------------------------------------------------------------------------------------------------------------------------

If the Record Type is "Customerscore these fields. (Data Quality Score field)
IF(Account.RecordTypeId=(000000000000000000),&
IF( ISBLANK( Name),0,0.384615385)+
IF( ISPICKVAL(Account_Vertical__c,""),0,0.384615385)+
IF( ISBLANK( MailingStreet ),0, 0.384615385)+
IF( ISBLANK( MailingCity ),0,0.384615385)+
IF( ISBLANK( MailingState ),0,0.384615385)+
IF( ISBLANK( MailingPostalCode ),0,0.384615385)+
IF( ISBLANK( MailingCountry ),0,0.384615385)+
IF( ISBLANK( NumberOfEmployees ),0,0.384615385)+
IF( ISBLANK( DunsNumber),0,0.384615385)+
IF( ISBLANK(Preferred_Language__c,""),0,0.384615385)+
IF( ISPICKVAL(Segment_2__c,""),0,0.384615385)+
IF( ISBLANK( NaicsCode ),0,0.384615385)+
IF( ISBLANK( Servicing_Division__c),0,0.384615385))
If the Record Type is "Customerdescribe these fields. (Description Field)
 
IF(Account.RecordTypeId=(000000000000000000),&
IF( LEN( Name) = 0, "Account Name, ","")&""&
IF( ISPICKVAL(Account_Vertical__c,""), "Account Vertical,","")&""&
IF( LEN( MailingStreet ) = 0, "Street, ","")&""&
IF( LEN( MailingCity ) = 0, "City, ","")&""&
IF( LEN( MailingState ) = 0, "State, ","")&""&
IF( LEN( MailingPostalCode ) = 0, "Postal Code, ","")&""&
IF( LEN( MailingCountry ) = 0, "Country, ","")&""&
IF( LEN( NumberOfEmployees ) = 0, "Number Of Employees, ","")&""&
IF( LEN( DunsNumber) = 0, "    Duns Number, ","")&""&
IF( ISPICKVAL(Preferred_Language__c,""), " Preferred Language,","")&""&
IF( ISPICKVAL(Segment_2__c,""), "Segment,","")&""&
IF( LEN( NaicsCode ) = 0, "NAICS Code, ","")&""&
IF( LEN( Servicing_Division__c) = 0, "Servicing Division, ",""))

Thanks in advance!
 
Nayana KNayana K
Use like this :
Account.RecordType.Name = 'Prospect' 

In same way for Customer
Synthia BeauvaisSynthia Beauvais
Hi Nayana! 

I am getting error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2
IF( 
RecordType.Name='Prospect',
IF( ISBLANK( Name),0,0.5)+
IF( ISPICKVAL(Account_Vertical__c,""),0,0.5)+
IF( ISBLANK( BillingStreet ),0, 0.5)+
IF( ISBLANK( BillingCity ),0,0.5)+
IF( ISBLANK( BillingState ),0,0.5)+
IF( ISBLANK( BillingPostalCode ),0,0.5)+
IF( ISBLANK( BillingCountry ),0,0.5)+
IF( ISBLANK( NumberOfEmployees ),0,0.375)+
IF( ISBLANK( DunsNumber),0,0.375)+
IF( ISPICKVAL(Preferred_Language__c,""),0,0.375)+
IF( ISBLANK( TEXT(Segment_2__c)),0,0.375),

IF(
RecordType.Name='Customer',
IF( ISBLANK( Name),0,0.384615385)+
IF( ISPICKVAL(Account_Vertical__c,""),0,0.384615385)+
IF( ISBLANK( BillingStreet ),0, 0.384615385)+
IF( ISBLANK( BillingCity ),0,0.384615385)+
IF( ISBLANK( BillingState ),0,0.384615385)+
IF( ISBLANK( BillingPostalCode ),0,0.384615385)+
IF( ISBLANK( BillingCountry ),0,0.384615385)+
IF( ISBLANK( NumberOfEmployees ),0,0.384615385)+
IF( ISBLANK( DunsNumber),0,0.384615385)+
IF( ISPICKVAL(Preferred_Language__c,""),0,0.384615385)+
IF( ISBLANK ( TEXT (Segment_2__c)),0,0.384615385)+
IF( ISBLANK( NaicsCode ),0,0.384615385)+
IF( ISBLANK( Servicing_Division__c),0,0.384615385)),0)