onSalesActivityCreate
Sales activity is any activity such as adding meetings, creating scheduled calls, adding follow-up tasks, adding call logs, or sending SMS or emails to a prospect that helps a deal to progress. Apart from standard sales activities configured in the Freshsales Suite system, custom sales activities can also be configured to meet specific business needs. For more information, see What are sales activities? How to use them?
The onSalesActivityCreate event is triggered and the registered callback method is executed, when a new sales activity is recorded in the Freshsales Suite system.
Subscribe to the onSalesActivityCreate event and register the callback by using the following sample manifest.json content.
"events": {
"onSalesActivityCreate": {
"handler": "onSalesActivityCreateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onSalesActivityCreateCallback: function(payload) {
console.log("Logging arguments from onSalesActivityCreate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity who triggered the onSalesActivityCreate event in the Freshsales Suite system.
- associationsobject
All associated objects of the sales_activity object, which specify additional information pertaining to the sales account.
- sales_activityobject
Information pertaining to the sales activity recorded in the Freshsales Suite system.
onSalesActivityUpdate
When an agent or sales rep updates a sales activity, the onSalesActivityUpdate event is triggered and the registered callback method is executed.
Subscribe to the onSalesActivityUpdate event and register the callback by using the following sample manifest.json content.
"events": {
"onSalesActivityUpdate": {
"handler": "onSalesActivityUpdateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onSalesActivityUpdateCallback: function(payload) {
console.log("Logging arguments from onSalesActivityUpdate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity who triggered the onSalesAccountUpdate event in the Freshsales Suite system.
- associationsobject
All associated objects of the sales account object, which specify additional information pertaining to the sales account.
- changesobject
Information pertaining to the changes that triggered the onSalesActivityUpdate event, specified as a JSON object of the following format:
"changes": { "misc_changes": {}, "model_changes": { //For non-array attributes "<sales_activity.attribute that changed>": ["New value", "Old value"] }, "system_changes": {} }
Example
"changes": { "misc_changes": {}, "model_changes": { "end_date": [ "2019-09-25T10:45:00Z", "2019-09-28T04:30:00Z" ], "start_date": [ "2019-09-25T10:15:00Z", "2019-09-26T04:30:00Z" ] }, "system_changes": {} }
- sales_activityobject
Information pertaining to the sales activity updated in the Freshsales Suite system.