1

I'm new to the API and I hope this is nothing more missing something in the documentation. I found the Change Data Capture Developer Guide and other documentation giving the endpoints for Platform Events, CDCs, PushTopics, and Generic Events subscriptions but can't find anything telling me how to get a list of custom CDC Objects, Push Topics, or (possibly) Generic Events. The documention only covers (AFAIK) how to get the name via the webapp. We want to get it programmatically in order to prepopulate a pulldown list in our API. The alternative seems to be forcing the customer to find the name of the CDC object, etc., on their own and then manually enter it into our form.

I suspect these may be tied to a root SObject but haven't seen anything saying what the key(s) is.

6
  • Are you looking to get the name of the selected CDC objects or you want to get the related ChangeEvent names of the objects?
    – Jayant Das
    Jun 12, 2019 at 1:51
  • I'm looking for the name to use when making the REST call to subscribe to the custom CDC channel. (Or to subscribe to a push topic.) It's for a management UI facade - the people who use it are probably going to be analysts who were told to pull the data from Saleforce but aren't Salesforce users themselves. In an ideal world the person assigning the work will include the correct name but it would be nice to provide a pulldown so they aren't stuck if the name is just a little off - an accidently dropped letter, etc.
    – bgiles
    Jun 13, 2019 at 17:40
  • Are you looking for active CDC objects or just the names? If you are looking in general all objects with CDC they are like objNameEvent. You can always query for Push Topics. For CDC, there's a single CDC channel and objects participating in CDC are posted to that channel.
    – Jayant Das
    Jun 13, 2019 at 17:56
  • Thanks. I've shared that with my coworker with a bit more SF experience than me and hopefully we'll be able to figure out how to map that to our problem.
    – bgiles
    Jun 13, 2019 at 22:13
  • Grrr - forgot there's no blank lines in comments. As for CDC the documents I linked to above showed three different CDC endpoints. One is 'all', which sounds like what you described. A second is 'standard', and I found a list of 20-ish standard channels for it. The third one is for 'custom' channels. I came across a udemy.com class on setting up custom CDC - but of course I can't find that course now that I'm ready for it! - but the documentation above discusses how to get the name of a custom CDC channel via the web interface.
    – bgiles
    Jun 13, 2019 at 22:16

1 Answer 1

1

I found the answer in the developer's guide PDF. Change Data Capture Developer Guide. I missed it in the online version - probably too focused on my question.

(begin quote)

Migrate Object Selections with Metadata API

Use the PlatformEventChannel metadata type to retrieve and deploy Change Data Capture object selections that you configured in Setup to another org.

The following is an example of a PlatformEventChannel component with the event names of three selected entities: Account, Contact, and the Employee__c custom object.

<?xml version="1.0" encoding="UTF-8"?>
    <PlatformEventChannel xmlns="http://soap.sforce.com/2006/04/metadata">
    <channelMembers>
        <selectedEntity>AccountChangeEvent</selectedEntity>
    </channelMembers>
    <channelMembers>
        <selectedEntity>ContactChangeEvent</selectedEntity>
    </channelMembers>
    <channelMembers>
        <selectedEntity>Employee__ChangeEvent</selectedEntity>
    </channelMembers>
    <channelType>data</channelType>
    <label>ChangeEvents</label>
</PlatformEventChannel>

(end quote)

Now I have to learn how to make that Metadata API call but I'm sure we're already doing that somewhere else in our code. I wanted to do that anyway since one of our standards is to provide output schemas whenever possible but the existing Platform Events subscriber hadn't implemented it yet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .