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
AvLavAvLav 

If condition with 'OR' in apex

Hi!

I want a complex condition: If ( cond_01 OR cond_02 OR cond_03) {...}.

But I always get an error message - Error: Compile Error: expecting a ritgh parentheses, found 'OR' at ...

My condition is same as the following:

IF ( (sthing_01 != sthing_02) OR (sthing_03 != sthing_04) OR (sthing_05 != sthing_06)) {...}

 

Is anybody know what's the problem?

Best Answer chosen by Admin (Salesforce Developers) 
AvLavAvLav
Ooh, I find out. I have to use '||' instead of 'OR'. :smileyvery-happy: