This topic describes how to set up Salesforce synchronization in your Agiloft knowledgebase.
To view a video tutorial on Salesforce syncing, click here.
- Create a Salesforce developer account.
- Have a test email account ready to use as a login and to receive notifications.
- Obtain your Salesforce security token. See: https://help.salesforce.com/apex/HTViewHelpDoc?id=user_security_token.htm
- Ensure that all fields which should be synced with Salesforce have been added to the knowledgebase.
Follow these steps
- In your Agiloft knowledgebase, select Setup > Sync > New > External Sync.
- In the External Sync window
- Set External System Type to Salesforce.
Set up Directions and Conflicts according to your system requirements.
In the ESA Settings tab...
For the Salesforce WSDL endpoint enter https://login.salesforce.com/services/Soap/u/33.0.
Note: This value will be 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: <SALESFORCEPASSWORD+SECURITYTOKEN>. For example, SfP@s5wrdSECURITYTOKEN.
In the Mapping tab, the objects in the Agiloft KB can be mapped with the external SalesForce system.
Currently all standard Salesforce tables flagged as Creatable are supported in Agiloft.
The complete list of supported tables can be seen here.
Some examples of mapping between Agiloft and Salesforce are:
Agiloft Company = SF Account
Agiloft Lead = SF Lead
Agiloft Person = SF Contact
Agiloft Opportunity = SF Opportunity
Agiloft SupportCase = SF Case.
Select a Salesforce entity next to a table and click Map to open the Field Mapping wizard.
Create all of the field mappings between the Agiloft tables and Salesforce:
Select a field to identify the time at which the records are modified.
- Select whether records are synchronized based on timestamps, or simply exported/imported in the update.
- Select the permissible operations that can be performed during the sync, on the side of both Agiloft and the Salesforce external system.
- Select how the record ID should be generated during sync. This can be done by either the external system or in Agiloft, in which case a prefix should be specified and a table column should be selected in which to store the generated IDs.
- When a multiple choice value is selected for mapping, a dialog box opens below where you can map the individual choice fields. This enables you to define the choice lists when the Salesforce and
Agiloft options are different in number and type.
- The Identifying column defines the fields that are used to establish the initial relationship of records which are not in sync yet by matching them in both systems. If you select the option "Use strict match for identification", the system will only synchronize if all Identifying fields are found to match; otherwise, it will try to identify by all fields, then narrow down until it can match by any field.
For an instructional video on Salesforce mapping, click here.
In the Filters tab you can use saved searches as filters for synchronized fields.
The Relation Mapping tab enables you to set linked field relations with mapped fields.
Fields from key linked sets in the Relation Mapping tab cannot be used in the Mapping tab as these will define primary relationships between the key tables. For example, Phone Number or Email fields in the Company mapping are part of the linked set between Company and Contact, and will make it impossible to set up a relationships between Company and Contact in the Relation Mapping tab.
Click Next, then Finish. This will create an entity set using the sync name, which will allow you to transfer your sync to another KB.
- It is highly recommended for all tables which have strict links for fields which are going to be synced, to select the 'Allow entries not in source table' option in the Mapping tab of the Linked Fields wizard.
Otherwise, the sync won't be able to save values from SF which aren't represented in the linked AL source. The same is for the unique attribute. For the Demo KB such modifications are:
- Lead table - compound field Company / Location Name should be not unique.
- Company and Person table - Linked Field to Locations should be set Loose, otherwise records with addresses not represented in the Locations table will fail on creation.
It is mandatory to match the required level of linked fields between Agiloft and Salesforce for the tables you are setting up to sync.
In Salesforce the Contract to Account relationship is mandatory, whereas in Agiloft it is a Contract to Company relationship and not required. In this case we need to set the Company linked field as Required. Navigate to Setup > Contract > Company linked field > Edit > Options Tab > Require the user to choose record(s) to be imported? > Yes > Finish.
- You can run the sync manually in a table's Action Bar by selecting Actions > Sync > Run <Salesforce account name>.
You can use a time-based rule to setup an automated sync process.
- Navigate to Setup > Sync / Edit the Salesforce configuration > Next > Next > Running tab > Select the 'By Actions (Rules/Workflow)' option > Finish.
- Navigate to Setup > Rules > New.
- In the Rule wizard, in the...
- General tab, enter a name and select a table.
- Rule Type tab, select At selected time intervals.
- Condition tab, select Run once per scheduled time interval.
- Schedule tab, set Apply Rule = <as necessary>.
- Action tab, click the Create Sync Action button.
- In the Sync Action wizard:
- Enter an action name.
- Select your configuration by performing a lookup for the External System ID control.
- Click Finish.
- Click Finish.
After that, the sync process will run based on the interval set on the Schedule tab.
The sync will operate for all tables mapped in the sync configuration, regardless of which table contains the rule. If you need to sync some tables separately, you will need to create a separate Salesforce ESA configuration for each table and use them in different sync actions. You should be careful with multiple Salesforce syncs that you do not create conflicts with existing mappings.
Supported Table List
The following table lists all of the Salesforce tables which are supported in Agiloft sync. This list was taken on May 2015, and may differ if Salesforce adds or removes any tables in future.
If you intend to synchronize attached file fields with Salesforce and ensure that changes are automatically reflected in Agiloft, you will need to add some code in the Salesforce developer account to act as a trigger. This will automatically update the last modified field of the parent record whenever the attached file is changed in the Salesforce account, which prevents the user from explicitly editing and saving the record after changing the attachment file.
The sync will create a new version of the file field whenever a change is made. Therefore, in the File with Versioning field setup, you should set "Enable Versioning" to Yes in the Options tab, or changes from Salesforce to Agiloft will only reflect the first time after sync. The Salesforce field "Attachment" can be used for the sync setup.
- In the home page of the Salesforce Developer Console, click File > New > Apex Trigger.
- Add a name - such as AttachmentTrigger - and select sObject = Attachment, and click Submit to save it.
In the console, enter the following code logic, customizing it to use your set of synchronized tables:
- Save the trigger.