Configure onDealCreate and onDealUpdate

onDealCreate

When a deal is created, the onDealCreate event is invoked and the registered callback method is executed.

Subscribe to the onDealCreate event, register the callback, and define the corresponding callback by using the following sample server.js content.

server.js
exports = {
  events: [
    { event: "onDealCreate", callback: "onDealCreateCallback" }
  ],
  onDealCreateCallback: function(payload) {
    console.log("Logging arguments from onDealCreate event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • associationsobject

    All associated objects of the deal object, which specify additional information pertaining to the deal created.

  • dealobject

    Information pertaining to the deal created.

onDealUpdate

When a deal is updated, the onDealUpdate event is invoked and the registered callback method is executed.

Subscribe to the onDealUpdate event, register the callback, and define the corresponding callback by using the following sample server.js content.

server.js
exports = {
  events: [
    { event: "onDealUpdate", callback: "onDealUpdateCallback" }
  ],
  onDealUpdateCallback: function(payload) {
    console.log("Logging arguments from onDealUpdate event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • associationsobject

    All associated objects of the deal object, which specify additional information pertaining to the deal updated.

  • changesobject

    Information pertaining to the contact whose details are modified in the Freshsales Classic system.

    Changes that triggered the onDealUpdate event, specified as a JSON object of the following format:

    "changes": {
      "misc_changes": {},
      "model_changes": {
        //For non-array attributes
        "<deal.attribute that changed>": ["Old value", "New value"]
      },
      "system_changes": {}
    }
  • dealobject

    Information pertaining to the deal updated.