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