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

Streaming API : Unable to receive notifications with "lastName" field in WHERE clause


I created a pushtopic in Salesforce with lastName field referenced in the WHERE clause of pushtopic query. My query is:
SELECT id, Company from Lead WHERE lastName='Mark'

Pushtopic got created in Salesforce, but when I subscribed to the pushtopic and started generating events with criteria that exactly matches my pushtopic query, I noticed that I am not receiving any notifications from Salesforce.

Is there any restriction from Salesforce that it does not allow the use of "lastName" field in WHERE clause of pushtopic query?

Shalindra Singh
There is no restriction. I tested in my developer org, it works fine for me with that query

User-added image

You can debug your push topic in after login into workbench Goto->Queries->Streaming Push Topic and then subscribe your push topic check.
I am receiving notifications for only update and undelete events. I've verified that for my pushtopic, all NotifyForOperationCreate,NotifyForOperationDelete, NotifyForOperationUndelete, NotifyForOperationUpdate are true.

It should send notifications for create and delete events also.

Shalindra Singh
Daniel PENG 9Daniel PENG 9
For people who fall into the same rabbit hole, I tried same thing and not able to get events from SF, interestingly when I do "SELECT Id,Name, firstName, lastName FROM Contact WHERE ((FirstName = 'Peng'))" in developer console directly, I was able to get results back, but when I sent this to pushtopic and subscribed to it, nothing happens even I created/updated a contact using that last name. What's hapening here is Name is a coupound object of first name and last name, So I tried Name = 'Daniel Peng', I was able to get events from SF when I create a contact using first name Daniel and last name Peng.