You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

ROQL Sentence fetches wrong value

Accepted answer
3
Views
4
Comments
edited Feb 21, 2018 10:39AM in Integrations and APIs 4 comments

Content

Flag1 & Flag2 is yes/no fields. Default value for flag2 was  'yes' before, now we changed to 'No value'.

I want fetch contact record with below mentioned 2 conditions

Condition 1 : flag1 is yes
Condition 2 : flag2 is no value (Default value) or flag2 is yes 

select ID,Contact.CustomFields.c.flag1,
          Contact.CustomFields.c.flag2 from Contact 
where Contact.CustomFields.c.flag1==1 AND (Contact.CustomFields.c.flag2 != 0 or Contact.CustomFields.c.flag2 == 'null') order by ID

In the above ROQL, even flag2 is equal to zero is also fetched. What is wrong in this ROQL sentence?

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!