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
G. RoskamsG. Roskams 

Push topics for close case

Hi all,
I was quit impressed about the push topics and the possibilities to follow up cases in real time. 1 problem, if a case is closed, no push topic is created.

I looked into the documentation for the pushTopics and it says: 'To receive notifications on the IsClosed field, the subscriber must subscribe to the Status field referenced in the query'. The status-field is into the query, but I receive no push topic ?

The code for the full pushTopic:

PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'CaseListUpdates';
pushTopic.Query = 'Select Id, CaseNumber, Status, Subject from Case where Status != \'Closed\'';
pushTopic.ApiVersion = 34.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;

When I create a new case, the JSON for the pushTopics is ok. When I edit the case (inline or with edit button), all ok.
But if I close the case, I don't receive a message...

Can anybody help me out ?

JSON Create case:
Message: {"channel":"/topic/CaseListUpdates","clientId":"e2lw76n5d63uvy16nfm65v5dxwn","data":{"event":{"type":"created","createdDate":"2015-09-02T10:21:31.000+0000"},"sobject":{"IsClosed":false,"Status":"New","Subject":"Case PushTopic !!","Id":"50024000002qU0pAAE","CaseNumber":"00001033"}}}

JSON update case:
Message: {"channel":"/topic/CaseListUpdates","clientId":"e2lw76n5d63uvy16nfm65v5dxwn","data":{"event":{"type":"updated","createdDate":"2015-09-02T10:20:48.000+0000"},"sobject":{"IsClosed":false,"Status":"Working","Subject":"test pushtpoic 12:11","Id":"50024000002qTsRAAU","CaseNumber":"00001032"}}}

Kind regards
Gunther Roskams
Certified Salesforce.com Developer
Best Answer chosen by G. Roskams
G. RoskamsG. Roskams
haha, Solved by myself.
remove the statement 'where status != closed. Now I get the message.