onSalesAccountCreate
When a sales account is created, the onSalesAccountCreate event is invoked and the registered callback method is executed.
Subscribe to the onSalesAccountCreate event and register the callback by using the following sample manifest.json content.
"events": {
"onSalesAccountCreate": {
"handler": "onSalesAccountCreateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onSalesAccountCreateCallback: function(payload) {
console.log("Logging arguments from onSalesAccountCreate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the entity who triggered the onSalesAccountCreate event in the Freshsales Suite system.
- associationsobject
All associated objects of the sales account object, which specify additional information pertaining to the sales account.
- sales_accountobject
Information pertaining to the sales account created when the onSalesAccountCreate event is triggered.
onSalesAccountUpdate
When a sales account is updated, the onSalesAccountUpdate event is is invoked and the registered callback method is executed.
Subscribe to the onSalesAccountUpdate event and register the callback by using the following sample manifest.json content.
"events": {
"onSalesAccountUpdate": {
"handler": "onSalesAccountUpdateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onSalesAccountUpdateCallback: function(payload) {
console.log("Logging arguments from onSalesAccountUpdate 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 onSalesAccountUpdate event, specified as a JSON object of the following format:
"changes": { "misc_changes": {}, "model_changes": { //For non-array attributes "<sales_account.attribute that changed>": ["Old value", "New value"] //For array attributes "<sales_account.array attribute that changed>": [["Old array"], ["New array"]] }, "system_changes": {} }
- sales_accountobject
Information pertaining to the sales account updated when the onSalesAccountUpdate event is triggered.