salesforce Change Data Capture not sending change event

0 votes

I am using firebase functions to subscribe to change events for opportunity using specified cometD. my handshake all is working but the change is not received at all. i have made sure that in setup Opportunity object is selected. Any advice on what else to check or debug as why nothing is happening?

export const helloWorld = functions.https.onRequest(async(request, response) => {
    functions.logger.info("Hello logs!", {structuredData: true});
   
    const data = {
        "url": "https://XX.salesforce.com",
        "accessToken": "XXX"

    }

    await cometd_setup(data)
    functions.logger.log("cometd_setup_done")

    await cometd.handshake(function (handshake:any) {
    if (handshake.successful) {
       functions.logger.log("successful opty sending data")
       cometd.subscribe('/data/OpportunityChangeEvents', cometd_processdata)
    } else {
        logger.info('Handshake failed', handshake);
    }
})

   response.send("Hello from Firebase!");
});

the method that process data is currently simply doing a console log as below

var cometd_processdata = function (server_data:any) {
    // Do something more useful with the data
    functions.logger.info("got new data:", server_data);
};
Mar 10 in SalesForce by CoolCoder
• 4,360 points
19 views

1 answer to this question.

0 votes

The name of the subscription channel for Change Data Capture (CDC) events on standard objects is /data/<Standard_Object_Name>ChangeEvent. For an Opportunity standard object, the CDC channel is /data/OpportunityChangeEvent (no s on the end)

answered Mar 12 by CoolCoder
• 4,360 points

Related Questions In SalesForce

0 votes
0 answers

Salesforce Apex SingleEmailMessage with Template to User not contact

Im trying to send an email in ...READ MORE

Feb 28 in SalesForce by surbhi
• 3,810 points
220 views
0 votes
1 answer

Salesforce Apex/JSON serialization with change on variable name

Apex does not support annotation for serialization. But, ...READ MORE

answered Mar 2 in SalesForce by surbhi
• 3,810 points
151 views
0 votes
0 answers

Local workstation way to access to Salesforce data

I'm having trouble answering a question. I'd ...READ MORE

Mar 4 in SalesForce by surbhi
• 3,810 points
45 views
0 votes
1 answer

Can we create a record for Event object through lwc in Salesforce?

You can check list of supported obejcts ...READ MORE

answered Apr 5 in SalesForce by CoolCoder
• 4,360 points
75 views
+2 votes
2 answers

Salesforce Interview questions

Here are some questions very important for ...READ MORE

answered Jan 11, 2019 in Career Counselling by Suresh
• 720 points
1,835 views
0 votes
1 answer

How to connect to salesforce from tableau?

Hi, follow these steps to connect to Salesforce: 1. ...READ MORE

answered Mar 25, 2019 in Tableau by Cherukuri
• 33,010 points
289 views
0 votes
1 answer

Power BI - Salesforce

Hi, Follow below steps: 1. Go to Data source. 2. ...READ MORE

answered Mar 25, 2019 in Power BI by Cherukuri
• 33,010 points
174 views
0 votes
1 answer

What is the best training for Salesforce ADM-201 Exam?

Hi @Vardhan, I took Edureka's Salesforce Training that covers all ...READ MORE

answered Jun 3, 2021 in Others by Jaya
• 140 points

edited Dec 22, 2021 by Soumya 204 views
0 votes
1 answer

Salesforce picklist values not showing up in picklist

For both standard and custom objects, go ...READ MORE

answered Mar 3 in SalesForce by CoolCoder
• 4,360 points
345 views
0 votes
1 answer

Salesforce Apex SingleEmailMessage with Template to User not contact

// Pick a dummy Contact Contact c ...READ MORE

answered Mar 17 in SalesForce by CoolCoder
• 4,360 points
66 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP