This topic describes how to set up Salesforce synchronization in your Agiloft knowledgebase. Synchronization between Salesforce and Agiloft allows you to integrate and update your data in real-time between both systems. If you already use Salesforce to manage marketing, sales, service, or other content, it's much easier to sync content between both systems than to manually re-enter existing data in Agiloft. Similarly, if you already have data in Agiloft and want to transfer that data to Salesforce, syncing the data saves both time and effort, and it ensures data in both systems is kept up to date.
All Salesforce tables are supported in Agiloft, including both standard tables and custom tables. For a given table, you can choose to sync some, all, or none of the fields.
To view a video tutorial on Salesforce syncing, click here.
- Have a working email account ready to use as a login and to receive notifications.
- Create a Salesforce developer account using your email account.
- Obtain your Salesforce security token after creating a Salesforce account. In Salesforce, click your user icon in the top right and go to Settings > My Personal Information > Reset Security Token. The security token is sent to your account's email address. For more information, see Reset Your Security Token.
- Ensure that all fields you want to sync with Salesforce have been added to the knowledgebase.
Before proceeding with the below steps, you may also want to review the tables and fields in Salesforce that already contain or will contain your data. To do so, click the dots in the top left to open the App Launcher. In the App Launcher, select the app that contains your data or most closely suits your integration purpose. You can then select a table and create a test record to see fields in that table.
In your Agiloft knowledgebase, select Setup > Sync > New > External Sync.
- On the General tab:
- Set External System Type to Salesforce.
Set up Directions and Conflicts according to your system requirements.
On the ESA Settings tab:
For the Salesforce WSDL endpoint, enter https://login.salesforce.com/services/Soap/u/33.0.
This value is updated from time to time by Salesforce. See the SOAP API Developer Guide for documentation on generating or obtaining the Web Service WSDL.
Enter your Salesforce account email login.
In the Password field, use the following format: salesforcepasswordSECURITYTOKEN. For example, SfP@s5wrdSECURITYTOKEN.
On the Mapping tab, map the objects in the Agiloft KB with the external Salesforce system. To map an object:
Locate the Agiloft table in the list and then select the corresponding Salesforce table from the drop-down menu.
Click Map. The Field Mapping wizard opens.
On the Field Mapping tab, select a field that provides the timestamp in each system to indicate the latest version of the record. If you choose the Synchronize option below, the timestamp field is compared between systems to determine which record's values are synced to the other system.
- Choose the matching sync direction from the General tab:
- Synchronize: Updates records in both systems based on the timestamp field.
- Export: Updates records in Salesforce to match field values in Agiloft.
- Import: Updates records in Agiloft to match field values in Salesforce.
- Choose which sync operations are allowed during the sync.
- Determine how the record ID is generated during the sync. This can be done by Salesforce or Agiloft. If you generate record IDs with Agiloft, you must also specify a prefix and a table column to store the generated IDs.
- For each Salesforce field you want to sync, select the corresponding
Agiloft field, and then choose whether the field value is updated in
Agiloft, Salesforce, or both systems. Update options are disabled if the sync direction does not permit them. For fields with multiple choice values, complete the dialog box that opens to map individual choice fields.
- Use the Identifying column to select fields to identify matching records between the systems. If you want to match records only when all the Identifying fields match, select the "Use strict match for identification" option. Otherwise, the system first attempts to identify matches by all fields, and if no match is found, it then narrows down the Identifying fields one at a time until a match is found.
- Click Next.
- On the Filters tab, if you need to prevent records created or updated in one system from being synced to the other, create a saved search to filter the desired records.
- Click Finish. The Field Mapping wizard closes.
- Repeat the previous steps for each table and set of fields you want to sync, and click Next when complete.
On the Relation Mapping tab:
Set any linked field relations between mapped tables. Linked relationships between Salesforce tables must be preserved with corresponding links in Agiloft or you cannot save the sync configuration. See the second bullet of the Additional Notes section below for more information.
Note that if you're directly mapping a single linked field on the Mapping tab, the linked set is unavailable on the Relation Mapping tab and vice versa.
- Choose whether the field values are updated in Agiloft, Salesforce, or both systems.
- Click Next.
On the Running tab, choose whether synchronization is initiated manually, via actions and rules, or via Salesforce.
To run a sync manually, go to a table's action bar and select Actions > Sync > Run [Configuration Name]
When configuring your sync, keep in mind the following two points to ensure the sync works properly:
- Make sure that each synced linked field allows entries not in the source table, which is configurable on the Mapping tab of the Linked Field wizard. For all fields, make sure that they do not require unique values, which is configurable on the Options tab of the Field wizard. These are necessary to allow the sync to save values from Salesforce that differ from
Agiloft values. The following fields are common changes in the out-of-the-box knowledgebase:
- Lead Table: The Company / Location Name field should not require a unique value.
- Company and Person Table: The linked field set to the Locations table should use the "Allow entries not in source table" option.
When using linked fields, you must also match required linked field relationships between Agiloft and Salesforce for the tables you are syncing.
In Salesforce, the Contracts to Accounts relationship is required. For any contract in the Contracts table, you must create a link to the Accounts table specifying the relevant account. In Agiloft, this relationship is instead a link from the Contracts table to the Companies table, but the link is not required for a given contract. If you're syncing the Contracts table, you need to go to the Contracts table in Agiloft and configure the linked set to the Company table to be required. You can do this on the Options tab of the Linked Field wizard by changing the "Require the user to choose record(s) to be imported?" option to Yes.
Use the following steps to set up a time-based rule to automate the sync process.
- Navigate to Setup > Sync and edit your Salesforce sync configuration.
- Click Next twice, and then click the Running tab.
- Make sure the "By Actions (Rules/Workflow)" option is selected and click Finish.
- Navigate to Setup > Rules and click New. The Rule wizard opens.
- On the General tab, enter a name and select the table you're syncing.
- On the Rule Type tab, select the "At selected time intervals" option.
- On the Condition tab, select the "Run once per scheduled time interval" option.
- On the Schedule tab, apply the rule however often you want the sync to occur.
- On the Action tab, click Create Sync Action. The Sync action wizard opens.
- Enter an action name.
- Click the lookup icon for the External System ID field and select your sync configuration.
- Click Finish. The Sync action wizard closes.
- Click Finish in the Rule wizard.
The sync operates for all tables mapped in the sync configuration, regardless of which table contains the rule. If you need to sync some tables separately, create a separate Salesforce sync configuration for each table and use them in different Sync actions and rules. However, be careful with multiple Salesforce syncs so that you don't create conflicts with existing mappings.
If you intend to synchronize attached file fields with Salesforce and need to ensure that changes are automatically reflected in Agiloft, you need to enter code in the Salesforce developer account. The code automatically updates the Last Modified field of the containing record whenever the attached file is changed in the Salesforce account, which ensures the latest version of the attachment is synced.
Because the sync creates a new version of the file whenever a change is made, in Agiloft you need to ensure that the field has Enable Versioning set to Yes on the Options tab of the Field wizard. Otherwise, changes from Salesforce to Agiloft are only reflected after the first sync.
- Click the gear icon in the top right of the Salesforce interface and select Developer Console.
- Go to File > New > Apex Trigger.
- Enter a name and select Attachment for the sObject field.
- Click Submit.
In the console, enter the following code, customizing it to use your set of synchronized tables:
- Go to File > Save to save the code.