TransWikia.com

PushTopic for OpportunityContactRole

Salesforce Asked by Vémundr on December 22, 2020

I’m creating PushTopics for streaming api and have trouble creating one for OpportunityContactRole object.

Executing the following apex code in Developer Console Window

PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'test';
pushTopic.Query = 'SELECT Id FROM OpportunityContactRole';
pushTopic.ApiVersion = 50.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;

returns the following error

Line: 10, Column: 1 System.DmlException: Insert failed. First
exception on row 0; first error: INVALID_FIELD,
‘OpportunityContactRole’ is not supported: [Query]

Similar code with another object (like Opportunity) works.

Is something different with OpportunityContactRole here?

One Answer

According to documentation only custom objects and a subset of standard objects (see below) support PushTopic queries:

Account
Campaign
Case
Contact
ContractLineItem
Entitlement
Lead
LiveChatTranscript
Opportunity
Quote
QuoteLineItem
ServiceAppointment
ServiceContract
Task
WorkOrder
WorkOrderLineItem

Answered by Alexander on December 22, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP