Multiple Criteria in COQL WHERE Clause

Multiple Criteria in COQL WHERE Clause

Hello all,
I'm having issues learning how to properly use the Where clause in COQL.  If I have a query like this..
  1. clientSearchMap = Map();
  2. clientSearchMap.put("select_query","select id from Contacts where Account_Name = '" + accountId + "' and Relationship_to_Household = 'Client' and Contact_Preference is not 'Do Not Contact' and (Mobile is not null || Email is not null)  ");
Written out a little easier to read..
select id from Contacts where 
- Account_Name = '" + accountId + "'
- Relationship_to_Household = 'Client'
- Contact_Preference is not 'Do Not Contact'
- and (Mobile is not null || Email is not null)

Just in case it makes a difference with the operators, Relationship_to_Household and Contact_Preference are picklists.

I'm sure it's user error on my end, but just wondering what the proper way to setup the criteria would be.

Thanks!


Moderation update:


Appending the solution to the requirement to retain context, as the original comment seems to have been removed by the comment owner.

    Access your files securely from anywhere

          Zoho Developer Community




                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day



                                        Zoho Marketing Automation
                                                • Sticky Posts

                                                • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

                                                  Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
                                                • Custom Function : Automatically send the Quote to the related contact

                                                  Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
                                                • Function #50: Schedule Calls to records

                                                  Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
                                                • Function #37: Create a Purchase Order from a Quote

                                                  Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,
                                                • Function-2: Round-Robin assignment of records

                                                  Welcome back folks! Last week, we saw how to update sales commission in quotes using a custom function. This week, let's see an interesting use case asked by many of you - auto-assignment records by round-robin method. Business scenario: Right now, the solution allows you to auto-assign leads from web form and imported lists. Let us look at a need where you want to auto-assign leads from in-bound calls in a round-robin method, across modules. Prerequisite: You must create a permanent record in the


                                                Manage your brands on social media



                                                      Zoho TeamInbox Resources

                                                        Zoho DataPrep Resources



                                                          Zoho CRM Plus Resources

                                                            Zoho Books Resources


                                                              Zoho Subscriptions Resources

                                                                Zoho Projects Resources


                                                                  Zoho Sprints Resources


                                                                    Qntrl Resources


                                                                      Zoho Creator Resources



                                                                          Zoho Campaigns Resources


                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Bill quantity received / PO quantity

                                                                                                    PO's are raised & often the quantity received is greater than the PO quantity, so when we receive the bill & adjust the quantity on the bill we get.... Quantity recorded cannot be more than quantity ordered. This necessitates the adjustment of the PO
                                                                                                  • Inventory API - How do I add a payment to a bill using the API?

                                                                                                    I can update the "notes" field but I don't know how to add a payment to an existing bill. Is this possible? Does someone have a working example?
                                                                                                  • Why Doesn't TrueSync Desktop App Have an Auto-Update Feature?

                                                                                                    I have to manually update the app myself. I think it's a big shortcoming.
                                                                                                  • Posibility to add Emoticons on the Email Subject of Templates

                                                                                                    Hi I´ve tried to add Emoticons on the Subject line of Email templates, the emoticon image does show up before saving the template or if I add the Emoticon while sending an Individual email and placing it manually on the subject line. Emoticons also show
                                                                                                  • Error AS101 when adding new email alias

                                                                                                    Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
                                                                                                  • Link Zoho Inventory to Clover POS

                                                                                                    Is it possible to link zoho Inventory to Clover POS?
                                                                                                  • How can I start trial version without any example data?

                                                                                                    I am lazy to manually delete each data in every section. Is there any button to fresh start my account from zero?
                                                                                                  • Send Whatsapp with API including custom placeholders

                                                                                                    Is is possible to initiate a session on whatsapp IM channel with a template that includes params (placeholders) that are passed on the API call? This is very usefull to send a Utility message for a transactional notification including an order number
                                                                                                  • Building a custom site

                                                                                                    do we have an option in Zoho to build custom sites like adding custom functionalities? want to make a site like https://trackscourier.com/jnt-tracking-ph/. Is it doable? Please assist.
                                                                                                  • Free developer edition of Zoho CRM

                                                                                                    A question for Zoho and other developers: How can you set up a demonstration version of a Zoho CRM implementation to show employers/clients what can be achieved? Do you pay for Zoho CRM Enterprise/Zoho One for this purpose? Does Zoho offer a free version
                                                                                                  • Confirmation prompt before a custom button action is triggered

                                                                                                    Have you ever created a custom button and just hoped that you/your users are prompted first to confirm the action? Well, Zoho knows this concept. For example, in blueprint, whenever we want to advance to the next state by clicking the transition, it is
                                                                                                  • Wrong Time on Exported Records

                                                                                                    Hello, All records in my exported Notes .csv file have the incorrect time for Created Time. They are all 8 hours ahead. I've already verified that my time zone is correct in both Personal Settings and Company Settings. Is there any way to fix this?
                                                                                                  • Selecting ZOHO Help Desk Plan for Startup

                                                                                                    Hello everyone, We at unisouk are setting up a Product support team for our platform. and probably we will be team of 3-5 people. Which plan would cater my needs to address customer technical queries and maintain the inflow of various channel queries
                                                                                                  • Where do we manage tags?

                                                                                                    Where is the page where we can view all tags and manage them (like change a tag name to something else or merge tickets under a particular tag with another)?
                                                                                                  • Possibilité de créer des boutons de raccourci dans les tickets Zoho Desk

                                                                                                    Bonjour, J'ai développé plusieurs automatisations avec Zoho Deluge pour optimiser la gestion des tickets. Je souhaiterais savoir s’il est possible de créer des boutons de raccourci directement accessibles dans l’interface des tickets afin de déclencher
                                                                                                  • Zoho CRM Customer Portal Pricing Question

                                                                                                    Hello, I am trying to find out about the pricing for a portal that will be used for the contacts and a custom module. My client needs to use a customer portal for 15k users that will display the contact details and some informations to a linked custom
                                                                                                  • Update to the Merge Tickets Functionality

                                                                                                    This is to inform you about a significant update to the Merge Tickets functionality in Zoho Desk.  Until now, while merging tickets, a user could set one ticket as the master ticket and choose the final value for any field from any of the secondary tickets too. As a result of this provision, many a time, crucial details related to the master ticket faced the risk of being excluded in the final, merged ticket. To overcome this challenge, we have decided to make the value of some critical fields unchangeable,
                                                                                                  • Chat function not working properly

                                                                                                    Ever since upgrading to plus, the chat is all messed up. it is coming up behind the web page so that I cannot see what I'm typing and cannot read replies. I can only see the bottom of the text box at the bottom of the page, and then it is blocked. I've
                                                                                                  • Setting up CRM for RFP workflow management

                                                                                                    This will be the first time our organization uses an off-the-shelf CRM, transitioning from our homegrown custom solution, and I would appreciate general thoughts on how to get started in general with our workflow using Zoho CRM. The main question: if
                                                                                                  • Integrating Calendly with Zoho Calendar in Zoho Mail

                                                                                                    I moved my office into a business incubator space that uses Calendly for meeting management and events. Calendly doesn't have a integration with Zoho Calendar and vice versa. I was directed to Zapier for integration but it doesn't have an integration
                                                                                                  • Unable to access Zoho Desk at all - has an extreme slow load and then just remains blank

                                                                                                    This is all I see:
                                                                                                  • Demande : Épingler automatiquement un commentaire via Deluge

                                                                                                    Bonjour, Je suis utilisateur de Zoho Desk et j'ai développé une fonction avec Zoho Deluge permettant d'ajouter automatiquement un type de commentaire à chaque création de ticket. Cependant, j'aimerais pouvoir épingler ces commentaires directement depuis
                                                                                                  • Unknown error occurred

                                                                                                    Hi, When we want to publish or edit a page in our website, we encounter with "Unknown error occurred" problem. I share a screenshot here. Our website is www.essoft.com. It happens every page. We want to solve this ASAP.
                                                                                                  • Using Creator API access tokens in deluge script

                                                                                                    I am working on generating download urls for files that are uploaded via a creator form. I want to include these urls in record templates so they can be easily accessed. The goal is to make downloading multiple attachments in a record as quick and easy
                                                                                                  • Option to Re-order from past orders

                                                                                                    Customers would like to place a repeat order with the business entity. Currently there is no option to support this and everytime the customer has to check out following the same process. Can a option be given to reorder from the past orders?
                                                                                                  • Display your zoho contact name when they call your mobile number

                                                                                                    As per the title If a contact calls the office number, the contacts name shows on mobile as long as I have their contact details registered in my crm. Is there a way that if the contact calls my mobile, their name can be displayed? Currently just their number shows when they call.
                                                                                                  • US to EU Data Migration done / Workflows and Custom Functions stopped working

                                                                                                    Hello, I need help to restore my workflow rules and custom functions to work. My data was transferred from the US to the EU (Data center migration). Now all Workflow Rules and Custom Functions not working. I have no idea how to restore them to work again.
                                                                                                  • Custom view for Milestones

                                                                                                    Hi, Just an idea for the future... would it be possible to create custom views for the Milestones view under Work Overview ? I usually need to look at this view filtered by project group but the filter doesn't remain when navigating away. A custom view
                                                                                                  • Email an Invoice from API

                                                                                                    When calling the API to email an invoice, it seems it does not actually send it. Below is a screen shot where I used an API call for the bottom record, and it updated its' status to "Due Today", but no email was actually sent. The top record, I hit the
                                                                                                  • How to delete Email Sent From CRM from Contact Records

                                                                                                    I can't figure out how to delete email sent form CRM from contact records. Can you please advise? 
                                                                                                  • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

                                                                                                    We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
                                                                                                  • Is there a Kanban view of Tasks across all Projects?

                                                                                                    As the title indicates, I could use a Kanban view of my Tasks across my Projects. If it's there, I don't see it. If it isn't there, I'd like to submit this as a feature request. Thx.
                                                                                                  • CRM Deluge how can link attach file with workdrive file.

                                                                                                    Hi, We have create file at workdrive and would like to link to attachment at crm module by deluge. Right now can only upload it to attachment but can not link the file from workdrive. Thank you
                                                                                                  • Tropicalize Books

                                                                                                    Books is an incredibly powerful tool that works well in many countries. But I feel that it is a product that is not yet "tropicalized" for Brazil as we speak (this would be like adapting the local reality). We have many strong competitors who do more
                                                                                                  • Refund of a check distribution fee...

                                                                                                    I use cashiers checks, from my local credit union, to pay some bills very occasionally. They charge me a 5.00 fee for this service, but then refund me that same amount at the end of the month on my statement. How would I record this transaction in Zoho
                                                                                                  • Usuários do Zoho Recruit no Brasil

                                                                                                    Gostaríamos de interagir com outros usuários do Zoho Recruit. Acabamos de completar um ano de utilização. Quem mais usa? se usa outra qual é?
                                                                                                  • Zoho Creator Upcoming Updates - December 2024

                                                                                                    Hi all, We're excited to be back with the latest updates and developments on the Creator platform. Here's what we're going over this month: Deluge AI assistance Rapid error messages in Deluge editor QR code & barcode generator Expandable RTF and multi
                                                                                                  • Questions about To Do

                                                                                                    1. I created a To Do note on Android and there is a line sorting option in the options drop down menu. But I didn’t find such an option in the PC client. I really need this option. 2. Why is there no search in To Do on the PC client? 3. Why is there no
                                                                                                  • Introducing Offer Details Sync to Zoho People

                                                                                                    We've introduced a new option for the Zoho People integration that allows you to push offer details when a candidate is converted to an employee. This simplifies your recruitment-to-onboarding process by seamlessly syncing critical offer information,
                                                                                                  • Conversion of functions from Google Spreadsheets

                                                                                                    Hello! I use this formula "=QUERY(ResumoOrdemVencimento!A3:O38;"SELECT A,B,C,D,E,F,G,H,I,J,K,L,M,N,O WHERE C != '' ORDER BY C,G")" in Google Sheets but when importing my spreadsheet into Zoho Sheets the formula was not converted. The QUERY function brings data from another spreadsheet, and then I sort and apply conditional formatting. The order of data will change automatically as I update the source spreadsheet. What Zoho Sheets function is equivalent to QUERY? I have some other spreadsheets to
                                                                                                  • Next Page