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
RonSFRonSF 

How to set boolean field depending upon the values of another field in same object

Hi

I need to set boolean field depending upon the values of another field in same object. So for example - If X.name = 'XYZ' then set the boolean field to True otherwise it is false. What is the best approach to tackle this issue ?

Thanks
RSF
Nishant SharmaNishant Sharma
Go for formula field with return type as checkbox. Following would be the formula:
IF(Name='XYZ',true,false)
Ajay K DubediAjay K Dubedi
Hey,
You can also create a formula field on the same object whose return type is a checkbox,this example is to help you in case of multi select picklist where there is a object called position__c and this checkbox will be true if the position that are selected are for manager rank. 
 
IF(INCLUDES(position__c, "Area Manager"), True,
    IF(INCLUDES(position__c, "Regional Manager"), True,
      IF(INCLUDES(position__c, "Division Manager"), True,
       IF(INCLUDES(position__c, "Zone Manager"), True,
        False
       )
     )
   )
)

 
RonSFRonSF
Hi Nishant 

What if I have multiple values meaning either Name = XYZ or ABC then do true. what would be the syntax. Thanks for response as well to Ajay.
 
Nishant SharmaNishant Sharma

Here you go...
IF(OR(Name='XYZ',Name='ABC'),true,false)
RonSFRonSF
 I was trying that but had incorrect syntax. Yr reply was faster. Thanx mate!!!
Nishant SharmaNishant Sharma
It is working fine for me. In any case, formula editor has picklist to choose various logcal function and input your field.User-added image

Please mark it as best answer, if it helps, to make community cleaner.
RonSFRonSF
Thankx Nishant