- Contents
- Index
Salesforce Integration Administrator's Guide
Apex controller
The Apex controller retrieves backend data from Salesforce, generates JSON strings using the Salesforce JSON.serialize API, and adds this data as the values for the entityId and params attributes in the click-to-dial component on custom Visualforce pages.
|
public class CustomClickToDialController { public CustomClickToDialController(ApexPages.StandardController stdController){} // Returns an ID of a Who/What record (for the entityId attribute). public String getId(){ Contact = [SELECT id, name FROM Contact LIMIT 1]; return contact.id; } // Returns a JSON string representation of Who/What record(s) (for the params attribute). // It could be a single Who/What record or a list of Who/What records. public String getJson(){ Account = [SELECT id, name FROM Account LIMIT 1]; return JSON.serialize(account); } } |
All returned “Who” records appear in the Name drop-down list in the call log. If the Apex controller returns only one “Who” record, it auto-associates this record with the Name text box in the call log.
All returned “What” records appear in the Related To drop-down list in the call log. If the Apex controller returns only one “What” record, it auto-associates the record with the Related To text box in the call log.


