0
votes

To get updates from salesforce Account, Contact and AccountContacRole objects into my local database. I have create pushTopic for Account and Contact object and receiving update messages using JAVA streaming client successfully.

But when I was creating pushTopic for AccountContactRole object using following query in developer console.

PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'ACRoleTableStreaming';
pushTopic.Query = 'SELECT AccountId,ContactId,IsDeleted,IsPrimary,Role FROM         AccountContactRole';
pushTopic.ApiVersion = 30.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;`

I am getting following Error message.

12:59:29:065 EXCEPTION_THROWN [10]|System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD, 'AccountContactRole' is not supported: [Query]

FYI I am using salesforce developer account and have also tries creating above pushTopic using https://workbench.developerforce.com. And Still gote same Error. i.e. "Error Creating Push Topic: 'AccountContactRole' is not supported."

Can anyone please tell me how can I create pushTopic for AccountContaactRole object
or
how can I get real time updates from this object into my local database using salesforce Streaming Client or any other method ?

1

1 Answers

0
votes

Not all the objects are supported in PushTopic queries, and AccountContactRole is one of them. Please find the below quoted text from Salesforce Streaming API Guide:

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. The following standard objects are supported in PushTopic queries through a pilot program: ContractLineItem, Entitlement, LiveChatTranscript, Quote, QuoteLineItem, ServiceContract."