1

Using the REST API (no Apex code), I want to get all the Events of a specific Lead or Contact (I have the Lead Id or the Contact Id) that has a specific string in the Description. What would that query look like?

Also, if you know of a good tutorial on how to form these queries, I'd really appreciate it! All of the examples I've seen are trivial (selecting from 1 record type, for example).

2

Unfortunately, what you are asking for is not possible. The description field (for that matter, any long-text field) cannot be used in the filter or WHERE clause of a SOQL query. Excluding the filter on Description, here is what your REST call would look like

/services/data/v32.0/query/?q=SELECT+id+FROM+Event+WHERE+WhoId+=+'YOUR_LEAD_OR_CONTACT_ID'

I recommend using the REST Explorer in Workbench to test your REST callouts: https://workbench.developerforce.com/login.php

| improve this answer | |
  • Nooooo! I knew something like that would happen. – user3827303 Oct 27 '14 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.