Unable to run onContactCreate serverless product event in Freshworks CRM app

Hi team,

I’m facing an issue where I cannot run serverless onContactCreate product event in the custom app.
I’ve checked my FDK version and all is up to date. Kindly check the screenshot and let me know if I’m missing something.

Server.js file

exports = {
  onContactCreateCallback: (args) => {
    console.log("Hello " + args["data"]["lead"]["email"]);
    console.log(moment().format());
  }
}

manifest.json file

"product": {
    "freshworks_crm": {
      "events": {
        "onContactCreate": {
          "handler": "onContactCreateCallback"
        },
     }
 }

Thanks in advance :blush:

Hi @mohammed

Good Day!

The error says that the 'onContactCreateCallback' function is not defined. Can you please try converting it to the normal function like the other two functions onContactUpdateCallback and onSalesAccountCreateCallback? and let us know if it works.

onContactCreateCallback: function(args) {
  // logic
}

Hope it helps

Thanks

1 Like

Hi Sujith,

Yes, it worked. Thank you for the solution.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.