Page tree
Skip to end of metadata
Go to start of metadata

The application is developed in Java to ensure that it can work in both Windows and Linux environments.
 
On running "startup.bat db_to_sf<profilename>", a mirror schema with the following structure will be created for each table in Salesforce.com


Salesforce.com Objects:
Table Name: sf[SF Object Name]
Column Name: SF[SF Column Name]

Control Columns:
Primary key: "SYNC_ID"
Date last modified: SYNC_LAST_MODIFIED_DATE_TIME
Flag to indicate sync status: DO_SYNC_FLAG
Flag to indicate merged record: MERGE_ID

Schema Requirements:

Create schema into a Database for replicating schema from Salesforce.com.

The schema will be created by running a command from the console. The application will evaluate the schema difference between Salesforce.com and Database - Salesforce DB instance and generate “ALTER TABLE” command to add the columns. It will not remove any columns for a given table to maintain historical data.

Note: All table names and columns will be trimmed to 30 characters in length

Data synchronization Requirements:

Salesforce.com to Database replication

The data replication from Salesforce.com to Database will be initiated every time a command from console is initiated. The application will maintain an association between Salesforce.com and Database table last synch timestamp. It will query all tables in Salesforce.com which have been created or modified since the last synch query and will perform an update or insert in Database tables.

Command: startup.bat <Profile Name>sf_to_db

The command to synchronize a particular table or object is

startup.bat <Profile Name>sf_to_db<SF Object Name>

SF Object Name can be any object from Salesforce.com – e.g. Account, Lead etc.

Database to Salesforce.com data Replication:

Database to Salesforce.com data replication.

The data replication from Database to Salesforce.com will be initiated every time a command from console is initiated. The application will maintain an association between Database and Salesforce.com table last synch timestamp. It will query all tables in Database which have been created or modified since the last synch query and will perform an update or insert in Salesforce.com tables.

Command: startup.bat <Profile Name>db_to_sf

The command to synchronize a particular table or object is

startup.bat <Profile Name>db_to_sf<SF Object Name>

SF Object Name can be any object from Salesforce.com – e.g. Account, Lead etc.

Parent Child Relationship Columns

To maintain the relationship for creation of new records from external system into Database Salesforce schema, the external application will have to establish relationship between the parent and child elements. To create a relationship in child or related table, the standard practice is to add a related column as REL[SF Table Name]ID to point to the primary key of "SYNC_ID" of the related / parent table.

Synchronization sequence example between Account and Contact:

  • A new account is added with two new contacts in Database. The contacts table "SFCONTACT" will contain a column called "RELACCOUNTID".
  • When the synchronization is initiated, the tool will do a check for "SFID" on the Account record. In case the SFID does not exist (which is Salesforce id) it will initiate an insert operation into salesforce.com and update the "SFID" back into that record in Database.

The system will do a check on SFCONTACT table and retrieve two new records without SFID and updates those records with respective SFIDs. At the same time it will find the external id, RELACCOUNTID and associates it to the right parent record into salesforce.com

Note:

Create a column with the following convention:

  • RELXXXXXID where XXXXX is the name of the parent Table.** Example: RELACCOUNTID column on SFCONTACT showing that Contact has a relationship with Account.
  • If the table is a custom field, then use RELXXXXX__C as the column showing relationship with another table.** Example: RELCONTACT_C column on SFSPECIALITYC showing that SPECIALITY_C has a relationship with CONTACT.
  • No labels