Wrong SOQL being generated with the List View Describe REST API call
Last updated 2018-02-10 ·Reference W-2497042 ·Reported By 20 users
A SOQL query returned by the List View Describe REST API call is incorrect if the listview on Contacts has a filter on Campaign Member Status.
1. Login to your org.
2. Create a listview on Contacts.
Contacts | Create New View
3. Select “DM Campaign into Top Customers - Nov 12-23, 2001” in "Campaign Name" of "Filter by Campaign".
4. Add “Filter By Additional Fields” and add “Campaign Member Status” equals “Sent”
5. Go to workbench
6. Go to REST Explorer.
utilities | REST Explorer
7. Enter the following URI, and then click Execute.
/services/data/v33.0/sobjects/Contact/listviews/<ID of the listview created at 2>/describe
8. Check the query value in the result.
You will see the soql as below:
SELECT name, account.name, title, phone, email, owner.alias, id, createddate, lastmodifieddate, systemmodstamp FROM Contact WHERE Id IN (SELECT ContactId FROM CampaignMember WHERE CampaignId = '701xx00000011uS') AND Status = 'Sent' ORDER BY Name ASC NULLS FIRST, Id ASC NULLS FIRST
As you can see, the Status condition is specified to the WHERE clause of the outer query, even though Contact does not have such a field and the condition has to be in the WHERE clause in the inner query.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.