0

I am trying to create a push topic notification for the Contract object via the following code:

PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'RefreshContract';
pushTopic.Query = 'SELECT Id, Name FROM Contract';
pushTopic.ApiVersion = 31.0;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;

When I try to execute the code via the Dev Console(Execute anonymous window) so I can define the channel for this object, I receive the following error:

System.DmlException: Insert failed. 
First exception on row 0; first error: INVALID_FIELD, 'Contract' is   not supported: [Query]

Any ideas? Is there any workaround to be able to receive push topic notifications for Contracts?

Thanks in advance.

1

Supported PushTopic Queries

All custom objects are supported in PushTopic queries. The following subset of standard objects are supported in PushTopic queries: Account, Campaign, Case, Contact, Lead, Opportunity, Task.

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.