Events API

Event APIs enable you to react to events that occur in the user interface of a page. This includes updates to field values. You can register event listeners which are invoked when an event occurs.

Event Payload
When the callback method is invoked, an event payload is passed to it. The payload is a JavaScript object which contains a type field and data object.

1
2
3
4
5
// event_type contains the name of the event var event_type = event.type; // event_data is a JSON whose value depends on the type of event var event_data = event.helper.getData();
Lead Details Page Events

The lead.update event is available to all apps located on the Lead Details page.

lead.update - This event is triggered when a user updates a lead.

Copied Copy
1
2
3
4
var eventCallback = function (data) { console.log(data.type + " event occurred"); }; client.events.on("lead.update", eventCallback);
Contact Details Page Events

The contact.update event is available to all apps located on the Contact Details page.

contact.update - This event is triggered when a user updates a contact.

Copied Copy
1
2
3
4
5
var propertyChangeCallback = function (data) { console.log(data.type + " event occurred"); }; client.events.on("contact.update", propertyChangeCallback);
Deal Details Page Events

The deal.update event is available to all apps located on the Deal Details page.

deal.update - This event is triggered when a user updates a deal.

Copied Copy
1
2
3
4
5
var propertyChangeCallback = function (data) { console.log(data.type + " event occurred"); }; client.events.on("deal.update", propertyChangeCallback);
Sales Account Details Page Events

The account.update event is available to all apps located on the Account Details page.

account.update - This event is triggered when a user updates an account.

Copied Copy
1
2
3
4
5
var propertyChangeCallback = function (data) { console.log(data.type + " event occurred"); }; client.events.on("account.update", propertyChangeCallback);

Log in with your Freshsales account

Enter your helpdesk URL to proceed to login

Proceed

By clicking "Proceed", you agree to our Terms of Use.