...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Panel | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
Table of Contents | style | circle
| ||||||||||||||||
|
When you have installed the ContactWorld managed package, you may want to customize Salesforce or ContactWorld features. You must take care as some changes can stop ContactWorld working as intended. These guidelines and best practices will help you extend ContactWorld with no negative impact.
Warning | ||
---|---|---|
| ||
NewVoiceMedia Vonage Contact Center can give advice on how to customize features, but, ultimately, customizing your integration safely is your responsibility. If you raise a support ticket, NewVoiceMedia Vonage Contact Center support may ask you to disable automated features to help them diagnose the issue. Automated features include triggers, workflow rules, and processes. |
ContactWorld call lifecycle overview
The following information describes the lifecycle of a ContactWorld call. This information demonstrates the importance of taking care when customizing ContactWorld and Salesforce.
Expand | ||
---|---|---|
| ||
Whenever a call takes place, our package performs the following actions. All actions happen in the context of one of two users:
Unless otherwise described, all actions happen in the context of the current user.
These operations are all internal to our package, and can change between package versions. Therefore we discourage customizing or interacting with these objects directly. |
Custom objects
The following objects are for internal use by ContactWorld. Creating, updating or deleting these objects can have a negative impact on ContactWorld in Salesforce.
Expand | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||
|
Best practices when creating triggers
Triggers and automation cause the most issues when customizing ContactWorld or Salesforce. If you experience an issue with ContactWorld in Salesforce, support will ask you to disable your custom triggers. This enables us to verify that the standard installation is working.
Create easy-to-disable triggers
Expand | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
We recommend that you make your triggers easy to disable. To create easy-to-disable triggers, perform the following steps:
When you create triggers and in all existing triggers, include the following code. This code checks that you have selected the Enable Triggers check box before running the trigger code. If you have not selected the check box, your trigger code does not run.
Using this method, you can enable or disable all relevant triggers. |
Use bulkified triggers
Expand | ||
---|---|---|
| ||
Trigger-bulkification is a Salesforce technique. Using trigger-bulkification, triggers can handle creation or updates of more than one record at a time. This technique helps avoid hitting governor limits on your triggers during a mass creation or update. Bulkifying means grouping up all your data manipulation operations into as few operations as possible. In practical terms, this usually means moving such operations outside of for-loops. For more information about bulkifying triggers, see Salesforce help and http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/. |
Avoid trigger looping
Expand | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
Performing data-manipulation (DML) operations in triggers that run after record inserts or updates can cause trigger looping. For example, a task object has a trigger which modifies a lead, and a lead object has a trigger that modifies a task. The task's trigger initiates the lead's trigger, and then the lead's trigger initiates the task's trigger, and so on. This situation results in an endless loop of trigger execution. To avoid this situation, wherever possible, use triggers that run before update or insert. DML is not allowed in triggers that run before update or insert. If you cannot run your triggers before insert or update, use the following code. The code protects your triggers from firing repeatedly by checking whether they are already executing:
The
For more information about avoiding trigger looping, see Salesforce help. |
Best practices when writing queries for large data sets
Non-selective queries can fail if you run the query on more than 100,000 records. If your organisation handles a large volume of phone calls, the number of ContactWorld records can exceed that limit over time.
Make your queries selective
Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
The following fields in our custom objects are indexed:
If you have to query our objects, use these fields in the WHERE clause to make the query selective. Alternatively, to protect your code from selectivity issues, surround your queries in try-catch blocks:
For more information on how to make your queries selective, see :https://help.salesforce.com/apex/HTViewSolution?urlname=How-to-make-my-SOQL-query-selective&language=en_US |
Best practices when creating validation rules
Validation rules on some objects or fields can prevent our managed package from creating objects. If you experience an issue with ContactWorld in Salesforce, support will ask you to disable your custom validation rules. This enables us to verify that the standard installation is working.
Create easy-to-disable validation rules
Expand | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
We recommend that you make your validation rules easy to disable. To create easy-to-disable validation rules, perform the following steps:
When you create validation rules and in all existing validation rules, include code which checks that you have selected the Enable Validation Rules check box before running. If you have not selected the check box, your validation code does not run. For example, the following code checks that
|
Best practices when creating flows and processes
Custom flows and processes can cause issues when customizing ContactWorld or Salesforce. If you experience an issue with ContactWorld in Salesforce, support will ask you to disable your custom flows and processes rules. This enables us to verify that the standard installation is working.
Create easy-to-disable processes
Expand | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
We recommend that you make your processes easy to disable. To create easy-to-disable processes, perform the following steps:
When you create processes and in all existing processes, include code which checks that you have selected the Enable Processes check box before running. If you have not selected the check box, your process does not run. The following code checks that the Enable Processes check box is cleared:
Let's assume that you want to create a process on Account object: |
Create easy-to-disable workflow rules
Expand | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
We recommend that you make your workflow rules easy to disable. To create easy-to-disable workflow rules, perform the following steps:
When you create workflow rules and in all existing workflow rules, include code which checks that you have selected the Enable Workflow Rules check box before running. If you have not selected the check box, your process does not run. The following code checks that
|
Best practices when integrating with call tasks
At the end of a call, a trigger creates a task record relating to that call. To avoid causing issues in ContactWorld, when you create task triggers or flows, take care not to interfere with this feature. The best way to avoid issues is to identify and handle ContactWorld tasks differently.
Exclude ContactWorld tasks from problematic trigger code
Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
You can identify ContactWorld tasks because they have values in ContactWorld custom fields. Custom fields include CW start time. If you have existing triggers on task creation or update, and they are having a negative impact on how your tasks are created, edit the triggers so they skip over ContactWorld tasks. The following code checks for a value in the
|
Use an embedded Visualforce page to keep a count of ContactWorld tasks
Expand | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
Sometimes you might want to know the number of tasks related to a specific Salesforce object, for example, a contact or lead. You can use this number in reports later. The easy, but not recommended, way to count tasks is to use a trigger. The trigger updates the count in a custom field on the related record. This method is likely to cause concurrent editing issues. Instead we recommend you use an embedded Visualforce page to view a count of related task records. To create a Visualforce page and embed it in the page layout, perform the following steps:
|
Use an embedded Visualforce page to report on ContactWorld tasks
Expand | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||
Instead of using triggers to create reports on ContactWorld tasks, we recommend that you embed a report in a page layout. To embed a report in a page layout, perform the following steps. The following steps describe adding a report to a contact object. Modify this method to add a report to another Salesforce object.
The following report is embedded in a contact record. The report shows that one short, two medium and one long call has been made or received in relation to this contact: |
Best practices when customizing incoming call popping
To customize incoming call popping, use SoftPhone layouts. For information about using SoftPhone layouts to customize incoming call popping, see Configuring advanced popping.
Best practices when interacting with Dial Lists and Dial Entries
Dial List and Dial Entries are custom objects in the Connect managed package. As with custom objects in the ContactWorld managed package, you must take care when interacting with these objects.
...