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, 2022 in SalesForce by CoolCoder
• 4,420 points
535 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)

It's recommended to go for the Salesforce course to learn more about firebase functions.

answered Mar 12, 2022 by CoolCoder
• 4,420 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, 2022 in SalesForce by surbhi
• 3,820 points
3,018 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, 2022 in SalesForce by surbhi
• 3,820 points
4,010 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, 2022 in SalesForce by surbhi
• 3,820 points
323 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, 2022 in SalesForce by CoolCoder
• 4,420 points
2,077 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
3,342 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,030 points
1,017 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,030 points
710 views
0 votes
2 answers

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

Hi @Vardhan, I took Edureka's Salesforce Online Training, ...READ MORE

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

edited Dec 22, 2021 by Soumya 707 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, 2022 in SalesForce by CoolCoder
• 4,420 points

edited Jun 19, 2023 by Khan Sarfaraz 16,313 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, 2022 in SalesForce by CoolCoder
• 4,420 points

edited Jun 27, 2023 by Khan Sarfaraz 4,533 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP