Relational Junction for Salesforce User Manual

Release 4.3.0 Copyright © 2004 Sesame Software, Inc.
All rights reserved.

(877) 496-6400 support@sesamesoftware.com

February 14, 2011

Contents
RELEASE NOTES .......................................................................................................................... 5  RELEASE 4.3.0 CHANGES ............................................................................................................... 5  RELEASE 4.2.0 CHANGES ............................................................................................................... 5  RELEASE 4.1.0 CHANGES ............................................................................................................... 5  RELEASE 4.0.0 CHANGES ............................................................................................................... 6  RELEASE 3.7.0 CHANGES ............................................................................................................... 6  RELEASE 3.6.2 CHANGES ............................................................................................................... 6  RELEASE 3.6.1 CHANGES ............................................................................................................... 6  RELEASE 3.6.0 CHANGES ............................................................................................................... 6  RELEASE 3.5.0 CHANGES ............................................................................................................... 6  RELEASE 3.4.1 CHANGES ............................................................................................................... 7  RELEASE 3.4.0 CHANGES ............................................................................................................... 7  RELEASE 3.3.1 CHANGES ............................................................................................................... 7  RELEASE 3.3.0 CHANGES ............................................................................................................... 8  RELEASE 3.2.0 CHANGES ............................................................................................................... 8  RELEASE 3.1.1 CHANGES ............................................................................................................... 8  RELEASE 2.5.3 CHANGES ............................................................................................................... 8  RELEASE 2.5.2 CHANGES ............................................................................................................... 8  RELEASE 2.5.1 CHANGES .............................................................................................................. 9  RELEASE 2.5.0 CHANGES .............................................................................................................. 9  INTRODUCTION ........................................................................................................................... 11  WHY CREATE A DATABASE FROM YOUR SALESFORCE.COM DATA? .................................................. 11  USE CASES ................................................................................................................................. 11  On-Site Data Retention ......................................................................................................... 11  Backup and Recovery ........................................................................................................... 11  History Tracking .................................................................................................................... 12  Business Intelligence ............................................................................................................ 12  Integration ............................................................................................................................. 12  INSTALLATION ............................................................................................................................ 13  HARDWARE PREREQUISITES ........................................................................................................ 13  Memory ................................................................................................................................. 13  Processors ............................................................................................................................ 13  Disk Space ............................................................................................................................ 13  SOFTWARE PREREQUISITES ......................................................................................................... 14  Operating System ................................................................................................................. 14  Network Access .................................................................................................................... 14  Java Runtime Environment ................................................................................................... 15  Databases Supported ........................................................................................................... 15  JDBC Drivers ........................................................................................................................ 15  PRODUCT INSTALLATION .............................................................................................................. 17  Windows................................................................................................................................ 17  UNIX...................................................................................................................................... 17  PRODUCT CONFIGURATION .......................................................................................................... 20  License .................................................................................................................................. 20  Salesforce Connection .......................................................................................................... 20  Database Connection ........................................................................................................... 21  Database Design .................................................................................................................. 22  Salesforce Preferences......................................................................................................... 23  Logging and File Locations ................................................................................................... 24  Notification ............................................................................................................................ 25  Selection Criteria................................................................................................................... 26 

Relational Junction for Salesforce User Manual Page 2 of 64

Example DB2 Configuration ................................................................................................. 27  Example MySQL Configuration ............................................................................................ 28  Example Oracle Configuration .............................................................................................. 29  Example PostgreSQL Configuration ..................................................................................... 30  Example SQL Server Configuration...................................................................................... 31  Example Sybase Configuration ............................................................................................ 32  MANAGING YOUR WAREHOUSE .............................................................................................. 33  OPERATIONAL CONSIDERATIONS .................................................................................................. 33  HISTORY TRACKING ..................................................................................................................... 34  Purpose and Limitations of History Tracking ........................................................................ 34  History Table Schema Creation and Modification ................................................................ 34  RUNTIME OPTIONS ...................................................................................................................... 35  -config suffix .......................................................................................................................... 35  -setDbPassword password ................................................................................................... 35  -setSfdcPassword password ................................................................................................ 35  -getSchema objectName ...................................................................................................... 35  -getSchemaGlobal ................................................................................................................ 35  -getAll objectName................................................................................................................ 36  -getAllGlobal ......................................................................................................................... 36  -getDeleted objectName ....................................................................................................... 36  -getDeletedGlobal ................................................................................................................. 36  -audit objectName ................................................................................................................. 36  -auditGlobal ........................................................................................................................... 36  -get objectName .................................................................................................................... 37  -getGlobal ............................................................................................................................. 37  -getById objectName ............................................................................................................ 37  -getByQuery objectName...................................................................................................... 37  -set objectName .................................................................................................................... 37  -setGlobal .............................................................................................................................. 38  -getRealTime ........................................................................................................................ 38  -repeat [second delay] .......................................................................................................... 38  -convertAttachment ............................................................................................................... 38  -convertDocument................................................................................................................. 38  -convertLead ......................................................................................................................... 39  -convertRTF objectName ...................................................................................................... 39  -merge objectName .............................................................................................................. 39  -getReference objectName ................................................................................................... 39  -getReferenceGlobal ............................................................................................................. 39  -getIndex objectName ........................................................................................................... 40  -getIndexGlobal ..................................................................................................................... 40  -getTrigger objectName ........................................................................................................ 40  -getTriggerGlobal .................................................................................................................. 40  -reset objectName................................................................................................................. 40  -resetGlobal .......................................................................................................................... 40  -dropTable objectName ........................................................................................................ 41  -dropColumn objectName fieldName.................................................................................... 41  -checkGlobal ......................................................................................................................... 41  -checkSchema objectName .................................................................................................. 41  -checkSchemaGlobal ............................................................................................................ 41  -clean .................................................................................................................................... 42  -cleanTemp ........................................................................................................................... 42  -build ..................................................................................................................................... 42  FORCED TERMINATION OF A JOB .................................................................................................. 42  REAL TIME OPTION IMPLEMENTATION ............................................................................................. 43 

Relational Junction for Salesforce User Manual Page 3 of 64

WHAT IS RTO? ............................................................................................................................... 43  WHAT ARE THE LIMITATIONS? ....................................................................................................... 43  WHAT IS AN RTO REPLICATION CYCLE? ................................................................................................... 43  HOW DOES RTO WORK FOR DOWNLOADS? .............................................................................................. 43  HOW DOES RTO WORK FOR UPLOADS?................................................................................................... 44  INSTALLATION AND SETUP ................................................................................................................... 44  BEST PRACTICES ......................................................................................................................... 49  Incremental vs. Full Download .............................................................................................. 49  Frequency of Replication ...................................................................................................... 49  Upload of New, Changed, and Deleted Records .................................................................. 49  Recovery of Deleted Record Structures ............................................................................... 50  Loading Very Large Warehouses ......................................................................................... 51  Uploading in Hierarchical Order ............................................................................................ 51  Pre-Populating Foreign Keys ................................................................................................ 52  Managing Tables that are not Replicateable ........................................................................ 52  Tracking Deletes and Record Status .................................................................................... 53  Mass Changing Records in Salesforce................................................................................. 54  ARCHITECTURAL LIMITS ............................................................................................................... 55  Use of Reserved Words for Field Names ............................................................................. 55  Use of Long Object and Field Names ................................................................................... 55  Exceeding Query Size Limits ................................................................................................ 55  CONVERTING LEGACY DATA ......................................................................................................... 57  Create your schema.............................................................................................................. 57  Populate your schema from Salesforce.com ........................................................................ 58  Create Legacy Primary Keys ................................................................................................ 58  Create Database Triggers to Maintain Default Values ......................................................... 58  Default LEGACY_ID ............................................................................................................. 59  Create Unique Indexes for Integration .................................................................................. 59  Create an ETL Step for the Top-Level Table ........................................................................ 59  Upload your Top-Level Table ............................................................................................... 60  Resolve Foreign Key Relationships ...................................................................................... 61  Prepare Update Trigger for the Second-Level Table............................................................ 61  Create an ETL Step for the Second-Level Table .................................................................. 62  Upload your Second-Level Table ......................................................................................... 62  Parallel Loading Large Tables to Salesforce ........................................................................ 62  TRACKING MERGED RECORDS ..................................................................................................... 63  POPULATING A DATA-ONLY SANDBOX .......................................................................................... 63 

Relational Junction for Salesforce User Manual Page 4 of 64

Release Notes
Release 4.3.0 changes
     Support Spring ’11 release of Salesforce.com (API 21.0) Fix Salesforce server null timestamp error introduced by Salesforce API changes in API 21.0 Improve accuracy of replication time frame logic, including ignoring of timestamps retrieved outside the requested range and setting the next start time to at least the start time of the current job Fix time frame history bug in PostgreSQL Support separate user counts for Standard and Platform users

Release 4.2.0 changes
    Support Winter ’10 release of Salesforce.com Support real time replication Support TriggerAutoEmail and TriggerUserEmail actions when sending records to Salesforce Support AllowFieldTruncation, giving the option to truncate data that does not fit within fields in Salesforce or reject the record

Release 4.1.0 changes
  Support Summer ’10 release of Salesforce.com Provide new useTimeStamps option to ignore changes to database records if the SYSTEMMODSTAMP values are future dated, thus relying on the DELETE_FLAG to control replication to Salesforce. This option is not recommended, and should be set to false, but is provided for backward compatibility for customers who have already implemented date-sensitive logic in their applications. Refactor incremental replication and delete processing to store history in UTC instead of local time to avoid issues with clock inaccuracies and eliminating underlap of replication time periods and missing records Refactor delete processing to use LatestDateCovered provided by API and making only one pass at deletes, eliminating duplicate deletes within a job New SQL Server drivers Fix -setupdated crashes due to error logging of messages over 4,000 characters Provide system-wide option to ignore SYSTEMMODSTAMP changes in setUpdated Update Oracle drivers to fix “ORA-17173 Not all return parameters registered” bug Bug fix for failed creation of new rj4salesforce configuration files Support Sybase 15.0.3 Allow separate -getByQuery control files for each configuration Create SQL Server character fields as NVARCHAR for SQL 2005 and above

         

Relational Junction for Salesforce User Manual Page 5 of 64

    

Ignore UserProfileFeed object, can’t be replicated due to special logic Create performance index on RJ_HISTORY Enhance -getByQuery to use same behavior as normal -get Fix rjTimeout issue in convertLead Revised user manual

Release 4.0.0 changes
    Support Spring ’10 release (API 18.0) Simplified command options. “-set” replaces “-setUpdated”. “-get” replaces “getUpdated” and “-getUpdateSOQL”. “-getUpdated” eliminated entirely due to scalability and rounding of timestamps issues. Provide for parallel downloads of multiple objects in “-getGlobal” command. New “-getInitial” command ignores deleted records on first load. This is automatically chosen by “-get” option if there is no history for an object.

Release 3.7.0 changes
     Support Winter ’10 release (API 17.0) New login endpoint https://login.salesforce.com/services/Soap/u/17.0 Allow initial loads that ignore deleted records using new -getInitialGlobal and getInitial objectName option Set data type to NVARCHAR instead of VARCHAR for text fields in SQLServer 2008 Desupport replication for the VOTE object due to incompatibilities introduced in API release 17.0

Release 3.6.2 changes
  Improve recovery of failed getUpdatedSOQL for attachments by setting the recover point at every 100 attachments instead of 20,000 Provide an –undelete command option to un-recycle records

Release 3.6.1 changes
 Support API Release 16

Release 3.6.0 changes
  Support Oracle OCI protocol Provide incremental attachment import from a directory

Release 3.5.0 changes
 Allow other applications to update Salesforce even when performing getUpdatedSOQL operations with the parallelUpdate option. This mode will

Relational Junction for Salesforce User Manual Page 6 of 64

 

check for the greatest timestamp retrieved in the final time interval to ensure that any records updated during that interval are retrieved the next time a replication is run. Fix “ORA-01000: maximum open cursors exceeded” error in getDeleted. Purge dropped Oracle work tables in getDeleted. Affects Oracle 10 and above, where work tables where left in the flashback area as “BIN$” tables.

Release 3.4.1 changes
              Implement Salesforce Winter '09 API (14.0) Improved scalability for –audit and –getDeleted Handle –getDeleted retrieval failures for archived Tasks and Events -getByID trim spaces in id control file -getTrigger generated code only for objects that are in the schema without creating new objects Use new Oracle driver to fix ArrayIndexOutofBounds in oracle jdbc driver and corrupting values of extremely small numbers (remove ojdbc14.jar and replace with ojdbc5.jar) Corrected history table schema logic to keep up with changes in base table Add field help text for custom fields to RJ_HISTORY metadata table For QuickBooks version change log table list to just those supported getAll now sets DELETE_FLAG properly, was showing deleted records as active getDeleted now closes cursors properly, was causing ORA-01000: maximum open cursors exceeded Fixed NullPointer error in history tracking close connection logic Implement new -build option which will run -getSchemaGlobal -getTriggerGlobal -getIndexGlobal -getUpdatedSOQLGlobal –getReferenceGlobal Remove automatic rebuild of indexes for Sybase which attempted to migrate clustering index to the ID field; Sybase does not implement metadata properly, so this cannot be supported.

Release 3.4.0 changes
   Generate history tracking tables (trackHistory option)
Improved –getDeleted option to also update records if time stamps do not match Salesforce. This option will compare all active IDs and timestamps in Salesforce against the database and add, delete, or uipdate records. New –audit object and –auditGlobal options, which combine –getUpdated and getDeleted options. -audItGlobal should be used weekly to ensure that all deleted records are flagged and gaurantee that the database is in perfect synch with Salesforce.

Release 3.3.1 changes
    Restrict getIndexGlobal and getTriggerGlobal to existing tables Make deletes more scalable Fix job timeout before the 20 minute login period expires Fix table locking on -getReference

Relational Junction for Salesforce User Manual Page 7 of 64

Release 3.3.0 changes
  Support Summer ’08 (API release 13.0) Support Document upload from the file system

Release 3.2.0 changes
     Support PostgreSQL DBMS Allow VARCHAR or CLOB fields to be shrunk and not automatically adjusted to Salesforce size via autoAdjustWidth property Dynamic adjustment of intervalMinutes in –getUpdatedSOQL according to the number of records found in any given interval, providing for even more scalable initial loads and handling of mass changes of hundreds of thousands of records Recording of the user who deleted a record via –getUpdatedSOQL Added getDeleted( ) API call to –getUpdatedSOQL to handle objects that do not expose deleted records to SOQL queries

Release 3.1.1 changes
Support Relational Junction web console, including web based  job setup  job submission  job monitoring  log browsing and viewing  configuration management  change management  Allow custom formula fields to be ignored by setting formulaFields property to false

Release 2.5.3 changes
   

Allow masking out of fields in setUpdated with new objectName.exclude property Deprecate objectName.fields parameter, replacing with objectName.include property (fields still works, but will be phased out in a later release) Throw an exception if any property name is unrecognized Set the SYSTEMMODSTAMP and LASTMODIFIEDDATE values for deleted records in –getUpdated to GMT instead of local time

Release 2.5.2 changes
  

Support API Release 12.0 DB2 V9 Support o DDL syntax changes DB2 Partitioned database support o Remove unique constraint on Salesforce ID (Partitioned DB2 only) o Enforce uniqueness on Salesforce ID by using update-first for DB2 Partitioned databases only

Relational Junction for Salesforce User Manual Page 8 of 64

      

 

Eliminate custom formula fields in database by setting formulaFields=false property Allow parallel jobs to run without locking RJ_HISTORY table. Kill if run file removed, with cleanup of open database cursors Kill if no I/O for 10 minutes to resolve Salesforce or database hangs. Cleanup of open database cursors. Use rjTimeOut=10 property to control the interval Cleanup open database cursors if CTRL-C pressed Keep bufferSize automatically set to 1 if BLOBS exist during retry logic Handle VARCHAR field character compatibility issues with SQL Server when sending to Salesforce. SQL Server is UCS-2, Salesforce is UTF-8. There is a general issue with non-UTF-8 databases; this addresses only VARCHAR fields sent to Salesforce from a SQL Server database which occurred with the Czech character set. getUpdated will now fall back to getUpdatedSOQL instead of getAll if there has been no replication of a table in the last 30 days or on initial load Allow recovery of an entire Account structure for a deleted Account and all it's child objects (Contact, Opportunity, etc.) using DELETE_FLAG='R' on just the Account level (or the parent table at any intermediate level if recovering just that part of the structure). Implemented by a revision to the -getTrigger procedure.

Release 2.5.1 Changes

  

Use first valid IP address that is not a loopback. Some systems show IP address as 127.0.0.1. Iterate through the list of ethernet devices that are not named "lo" and use whatever has an active IP. Ignore invalid characters in long text fields which were causing invalid XML errors when loading to Salesforce Allow merging of Leads, Accounts, and Contacts Improve update performance for -getUpdated, -getUpdatedSOQL, and -getAll by approximately 250%. If most of the records are updates, the update logic will be done first. If most of the records are inserts, the insert logic will be done first except on DB2 partitioned databases.

Release 2.5.0 Changes
1. Support for Winter '08 Release of Salesforce.com (API Release 11.0) 2. Set DELETE_FLAG=U to "N" after successful update (delete_flag=U is now recommended instead of using SYSTEMMODSTAMP to trigger update in setUpdated) 3. Send warning email if license expired 4. Syncronized deletes with new -getDeleted command to support mass synchronization when recycle bin overflows or infrequent getUpdated causes audit trail to be lost for getUpdated. 5. Automatically set buffersize to 1 for "get" commands on Document table to prevent out-of-memory condition 6. Handle new URL format to parse API level properly. This had caused login failures unless API 10.0 was being used.

Relational Junction for Salesforce User Manual Page 9 of 64

7. Subtract one day from Organization.CreatedDate to determine the minimum date to search for by getUpdatedSOQL for new tables. Instances of other tables having records earlier than the Organization.CreatedDate were causing records not to be replicated. 8. Verify and delete all records in a table that were not deleted by getUpdated via new -getDeleted and -getDeletedGlobal options. Salesforce.com can lose the audit trail for deleted records if your recycle bin "overflows" or records are deleted and the recycle bin is emptied. These commands can be run once a week, but are not recommended to be run on a frequent cycle because of the overhead both in retrieving every single record for tables selected and the amount of database processing required to validate the existence or absense of records. This command will also add any missing records to the database.

Relational Junction for Salesforce User Manual Page 10 of 64

Introduction
Why create a database from your salesforce.com data?
Salesforce.com s a leading Application Service Provider of Sales Force Automation and Customer Relationship Management solutions, and is a platform for building custom solutions. The premise of “No Software” gives customers the ability to get have a web hosted service with no internal setup and no support staff. However – Salesforce.com also hosts your database, and back-end reporting and integration with in-house applications is not possible without sophisticated AppExchange™ API programming. Relational Junction for Salesforce provides an elegant solution which simplifies integration and reporting. Relational Junction for Salesforce creates and synchronizes a database that is a mirror of your Salesforce.com data, including all custom objects and fields. Relational Junction for Salesforce is a unique solution that does not have scalability limitations of spreadsheet-based tools, and replicates both to and from your local database. All objects and fields are automatically created in your local database.

Use Cases
Relational Junction for Salesforce is a totally automated Java ETL engine that uses the AppExchange™ API and JDBC to  Replicate a complete copy of your Salesforce.com data into a database, including all data structures and all data content. All Salesforce.com objects will be created as tables, and all Salesforce.com fields created as database columns.  Synchronize the database with recent changes to your Salesforce.com data as often as every 5 minutes.  Modify data in the local schema, and replicate the changes to Saleforce.com.  Migrate legacy data to Saleforce.com – Accounts, Contacts, Leads, Opportunities, Products – not limited to standard Salesforce.com uploads  Write reports using your preferred reporting tool  Integrate other back-office databases. Examples of this include maintaining customer and product data, building sales orders or invoices in your accounting system, and maintaining Salesforce user accounts using your HR data.

On-Site Data Retention
Relational Junction provides an on-site database backup of all of your Salesforce data via an efficient and frequent replication process. There is no design or data mapping involved, and setup takes only minutes. Both the software and your database are onpremise, so there is no concern about off-site data storage or outside services that could compromise your data security.

Backup and Recovery
The replication process can be bi-directional, allowing recovery of lost data from the database backup directly into your Salesforce.com. Relational Junction marks deleted records as inactive in the database, but does not physically remove them. This allows you to restore any amount of deleted data, including the entire hierarchy of accounts, contacts, opportunities, and related data without significant preparation and with all

Relational Junction for Salesforce User Manual Page 11 of 64

relationships intact. Even fields that have been permanently removed from Salesforce.com can be easily recovered.

History Tracking
Many companies have audit requirements that demand periodic snapshots of customer data, or versioning of specific changes of Salesforce data. Changes can be logged in the database to keep all versions of a record and even deleted records. This is accomplished using history tables that can track selected fields. The entire database can be backed up periodically to provide a point-in-time snapshot. The flexibility of relational technology makes all this possible.

Business Intelligence
Sophisticated analysis of customer data can be done with conventional reporting tools that go beyond native Salesforce.com reporting, including complex statistical and trending analysis. Having a local copy of your Salesforce data enables a broader range of reporting software, and improves performance over solutions that report directly against Salesforce.com through the API.

Integration
Integration with external data sources is facilitated by having your Salesforce data in a relational database. This feature opens your data to any number of ETL technologies, including “home grown” code and a variety of vendor ETL products, including Relational Junction ETL Manager. It also makes the data available for external systems to use directly. Many companies have even developed customer-facing portals directly on the Relational Junction schema, allowing developers to focus on business logic rather than the complexities of the Salesforce API.

Relational Junction for Salesforce User Manual Page 12 of 64

Installation
Hardware Prerequisites
There are minimal hardware requirements for Relational Junction for Salesforce, but there are factors that will improve scalability. The first decision is whether to run the loader on the same server as the database. Rather than add CPU’s to your database machine and increase its load and database licensing costs, it may be better to run Relational Junction on its own machine. Either configuration will work, however.

Memory
If Relational Junction for Salesforce is installed on a separate server than the database, a one-processor machine with 2.0 GB of physical memory will be adequate for any organization.  There operating system memory size depends on the vendor and configuration.  The loader will use approximately 1 GB of virtual memory for uploads to Salesforce and approximately 300 MB for downloads. This can be tuned to use 512 MB of virtual memory for uploads if the bufferSize property is set to 100 and the Xmx parameter on the java command line of the RJ4Salesforce script is set to 512MB. If you desire to run parallel jobs, each job’s memory should be added to calculate the total memory requirement.  Your database vendor should be consulted for the database memory requirements. The database should not be on the same machine for optimal performance, but it can be if there is enough memory and CPU to support the database.

Processors
The number of processors is primarily a function of reporting requirements, since the actual replication process is gated on the Salesforce SOAP API rather than raw database performance. One single threaded replication process consumes 40% of a single CPU. Therefore a single processor is sufficient if running the loader on a separate machine than the database, and one or two processors would be adequate if running the loader and the database on the same machine.

Disk Space
The size of the database will be equivalent to the space used in Salesforce.com (see Setup | Data Management | Storage Usage). All tables and indexes are created in one tablespace by default. It is advisable to split database disk I/O over more than one physical drives. Ideally, there would be one partition for the operating system, one for the database software, one for the tables, and one for the indexes, with the tables and indexes being on separate physical drives for minimal read/write contention. Relational Junction supports multiple tablespaces at database creation time with the tableSpace and tableSpaceIndex options. DB2 also supports putting long text and binary data in a separate tablespace with the tableSpaceLob options. Oracle does not need this because the typical record contains

Relational Junction for Salesforce User Manual Page 13 of 64

very little actual data in the CLOB fields and Oracle can chain records across blocks if it has to.

Software Prerequisites
Operating System
The following operating systems are supported:
            

Windows 2000 Windows Server 2003 Windows Server 2008 Windows XP Windows Vista Windows 7 Red Hat Enterprise Linux Solaris 8 SPARC Solaris 9, 10 (SPARC and x86) Sun Java Desktop System Macintosh OS X IBM AIX Ubuntu UNIX

Windows uses .BAT files for job control. UNIX requires a Bash or Korn shell command line interface. The UNIX shell scripts provided use bash, but can be converted to Korn by changing the first line to point to the Korn shell interpreter.

Network Access
Database Ensure that the Relational Junction server has network access to the database you intend to use, using whatever ports your database listeners are set to use. API Servers If you utilize IP address filters, white list the following Salesforce.com IP addresses for ports 80 and 443:
   

204.14.232.0 to 204.14.232.127 East Coast Data Center (set one) 204.14.233.0 to 204.14.233.127 East Coast Data Center (set two) 204.14.234.0 to 204.14.234.127 West Coast Data Center (set one) 204.14.235.0 to 204.14.235.127 West Coast Data Center (set two)

This list may not apply to customers outside the United States. If there are issues, please contact our support center for assistance. Proxy Server If you have to go through a proxy server to get to Salesforce.com, use the following parameters in your rj4salesforce.properties file: http.proxyHost – proxy host IP http.proxyPort – port Relational Junction for Salesforce User Manual Page 14 of 64

http.proxyUser – optional authentication user http.proxyPassword – optional authentication password License Manager Port 80 access to www.sesamesoftware.com is required for license management. If access is blocked, the product will run but only if you have purchased a production license with enough users to cover your active Salesforce.com user base. Relational Junction for Salesforce does not send any private data other than organizational identification, product, database, and operating system release levels, and the number of active Salesforce.com users. This allows the product to continue running if you exceed your licensed use counts, and provides our support team with information so that we can send targeted release bulletins that affect specific operating environments. Email If you utilize email security filters, white list or otherwise add Salesforce.com’s IP address space to your list of trusted addresses. From the Mirrorforce test page, send yourself an email. This email will route through the new network so it is important that you take note of whether or not you receive it.

Java Runtime Environment
The product is a Java-based application. You will first need to download and install the J2SE JRE available at http://java.sun.com on the server on which you intend to run the loader and configuration tool. IBM’s 1.6.0 Java is also supported. Relational Junction for Salesforce requires Java 1.5.0 or 1.6.0 but will not work on earlier or later releases.

Databases Supported
Relational Junction for Salesforce supports the following databases:  DB2 (9)  MySQL (5.0 or later)  Oracle (8, 9, 10, 11)  PostgreSQL (8.1 to 8.3)  SQLServer (2000, 2005, 2008)  Sybase (12, 15)

JDBC Drivers
The following JDBC drivers are distributed with Relational Junction for Salesforce: DBMS DB2 Vendor IBM Driver / jar files com.ibm.db2.jcc.DB2Driver  db2java.zip  db2jcc.jar  db2jcc_javax.jar  db2jcc_license_cu.jar  db2jcc_license_cisuz.jar com.mysql.jdbc.Driver  mysql-connector-java-3.0.16ga-bin.jar Remarks included with DB2

MySQL

MySQL

included with MySQL

Relational Junction for Salesforce User Manual Page 15 of 64

Oracle

Oracle

oracle.jdbc.driver.OracleDriver  ojdbc5.jar

PostgreSQL SQL Server Sybase

PostgreSQL Sprinta Sybase

org.postgresql.Driver  postgresql-8.3-603.jdbc3.jar net.sourceforge.jtds.jdbc.Driver  jtds-1.2.5.jar com.sybase.jdbc3.jdbc.SybDriver  jconn3.jar

Included with Oracle; using either thin protocol or OCI protocol if available for your platform. We strongly recommend the Oracle 10g thin driver, which is included. Included with PostgreSQL Open source SQLServer driver Included with Sybase database

Relational Junction for Salesforce User Manual Page 16 of 64

Product Installation
Windows
1. Unzip the product installation zip file. 2. If you are using Relational Junction for Salesforce without the web user interface, create a new directory named C:\RelationalJunction and put the unzipped installation directory here. You may vary this name if required. If you are using the web user interface, put the rj4salesforce installation directory in the Tomcat\webapps\rj\WEBINF directory. 3. You will have an rj4salesforce directory structure that looks like this:  bin – scripts  conf – configuration files  data – control files for special record selection processes, by query or by record ID  export – tab-delimited text file of all read operations, useful for auditing and historical research. These should be periodically removed via the –clean runtime option.  lib -- java binaries, database drivers, and Relational Junction, including o rj4salesforce.jar – The Relational Junction application o sforce[RELEASE].jar – AppExchange™ API interface. The RELEASE number will vary with the version of the API interface. Version 12.0 would be sforce120.jar. To upgrade a release, remove the old sforce[RELEASE].jar file and copy in the new one provided in the new product release.  sql – database utility scripts  log – log files. These should be periodically removed via the –clean runtime option.  tmp – work files. These should be periodically removed via the –clean or –cleanTmp runtime options. 4. It is highly desirable to use the UTF-8 character set in your database, which is set when the database is created. 5. Set the time zone of the Relational Junction server to the same time zone as the local database. 6. If you are using DB2, MySQL, Oracle, or Sybase, you must use the UTF-8 character set in the database, which is set when the database is created, or you will either lose multi-byte character capability or corrupt multi-byte characters. SQLServer is a UCS2 database and may have issues with character conversion of some languages.

UNIX
1. You will need root access for part of the following installation on UNIX systems. It is recommended that the product be installed under a normal UNIX user account instead of root, but there are a few setup steps that must be performed as root. 2. Create an ‘rj’ UNIX account with standard permissions. 3. Set the ulimit maximum number of open files for the UNIX account to 4096 or higher. On Linux, this is set in /etc/security/limits.conf. 4. Install Sun J2SE 1.6.0 JRE available at http://java.sun.com 5. Change to the rj UNIX account, using that account’s environment su - rj

Relational Junction for Salesforce User Manual Page 17 of 64

6. FTP the product installation file from the support site into the rj home directory. 7. Extract the product files unzip rj4salesforce.[release].zip where [release] is the file qualifier for this release. 8. If you are using Relational Junction for Salesforce without the web user interface, the rj4salesforce installation may be in the home directory of the rj UNIX user, or anywhere desired. If you are using the web user interface, put the rj4salesforce installation directory in the tomcat/webapps/rj/WEB-INF directory. 9. As root, create a symbolic link to the Relational Junction directory cd /usr/local rm -f rj4salesforce ln -s ~rjrsalesforce rj4salesforce Hereafter, it will be assumed that the installation directory alias has been created with this name. You may vary this name if required or even skip this step, but will have to modify a number of scripts and the properties file to use a different name. 10. You will have an rj4salesforce directory structure that looks like this:  bin – scripts  conf – configuration files  data – control files for special record selection processes, by query or by record ID  export – tab-delimited text file of all read operations, useful for auditing and historical research. These should be periodically removed via the –clean runtime option.  lib -- java binaries, database drivers, and Relational Junction, including o rj4salesforce.jar – The Relational Junction application o sforce[RELEASE].jar – AppExchange™ API interface. The RELEASE number will vary with the version of the API interface. Version 12.0 would be sforce120.jar. To upgrade a release, remove the old sforce[RELEASE].jar file and copy in the new one provided in the new product release.  sql – database scripts  log – log files. These should be periodically removed. These should be periodically removed via the –clean runtime option.  tmp – work files. These should be periodically removed via the –clean or –cleanTmp runtime options. a. Modify all scripts in the bin directory to use the appropriate shell program by changing the first line to point to your bash or ksh shell program. You can find the location of this by typing the command “which bash” or “which ksh”. 11. Make sure that the files RJ4Salesforce and RJ4Salesforce.ksh in the bin directory are executable by running the command “chmod 744” against them. 12. If you are using DB2, MySQL, Oracle, or Sybase, you must use the UTF-8 character set in the database, which is set when the database is created, or you will either lose multi-byte character capability or corrupt multi-byte characters. SQLServer is a UCS2 database and may have issues with character conversion of some languages.

Relational Junction for Salesforce User Manual Page 18 of 64

13. Set the time zone of the Relational Junction server to the same time zone as the local database. If you wish to set the time zone to UTC (GMT), set TZ=UTC in the environment of the rj UNIX account and the database UNIX account.

Relational Junction for Salesforce User Manual Page 19 of 64

Product Configuration
Modify the rj4salesforce.properties configuration file, using any text editor or the RJ Manager UI feature. If you edit the OS file directly you must make sure the property names are exactly as shown as they are case sensitive. Note that both the OS file property name and the UI titles are shown. If you wish to create multiple configurations, you can add a suffix to the file name (e.g.: rj4salesforce.properties.test) and refer to this version with the “–config test” command line option. If you are using the RJ Manager UI feature you cannot use the non-suffixed property files as they are not supported there. Please see the Relational Junction User manual for how to use the UI.

License
o licenseKey=License Key #1 The product license key, to be provided upon purchase of a license. The key distributed with the product will work for 15 days. licenseKey2= License Key #2 The secondary product license key, to be provided upon purchase of a license, if you have a second network interface card on your server.

o

Salesforce Connection
o sfdcUser=Salesforce User The Salesforce.com user name. You should ideally use a separate account for this, such as rj@yourdomain.com, to provide an audit trail when records are modified and to customize security. Clone the System Administrator profile into “Relational Junction”, remove all the Administrative Permissions except “Modify All Data”, “View All Data”, “Edit Read Only Fields”, “Transfer Record”, and “Password Never Expires”, and assign the rj@yourdomain.com account to this profile. sfdcPassword=Salesforce Password The Salesforce.com password. This can be changed here, or set as an encrypted value with the command line interface using the setSfdcPassword script and supplying the password as the single parameter. connectUrl=Connection URL The URL of the Salesforce.com API server. Omit this parameter in normal use. It is only for users who have a sandbox or pre-release site. The sandbox URL is typically https://login.salesforce.com/services/Soap/c/api_version is the new recommended endpoint for API login requests, where api_version specifies the API version, such as 21.0 https://test.salesforce.com/services/Soap/u/21.0 Note that the last node is the release of the API, which changes with every Salesforce.com release. http.proxyHost=Proxy Host If you have to go through a proxy server to get to Salesforce.com or the www.sesamesoftware.com license manager, add the IP address of the proxy server. Relational Junction for Salesforce User Manual Page 20 of 64

o

o

o

o o o o

o

o

o

http.proxyPort =Proxy Port The port number of the optional proxy server. http.proxyUser=Proxy User The optional userid used to authenticate to the proxy server. http.proxyPassword=Proxy Password The optional password used to authenticate to the proxy server. http.proxyKeyStore=Proxy KeyStore If the CISCO ACE (Application Control Engine) module is being used this is the name of the keystore. http.proxyKeyStorePassword=Proxy KeyStore Password If the CISCO ACE (Application Control Engine) module is being used this is the password for the keystore. http.proxyTrustStore=Proxy TrustStore If the CISCO ACE (Application Control Engine) module is being used this is the name of the truststore. http.proxyTrustStorePassword=Proxy TrustStore Password If. the CISCO ACE (Application Control Engine) module is being used this is the password for the truststore.

Database Connection
o o o o o o DBMS=DBMS (DB2 | MySql | Oracle | SQLServer | Sybase | PostgreSQL) Database vendor host= Host The network name of the server. port= Port The TCP/IP port of the database. database=Database The database name or Oracle SID. sid= Database Type: Database or Oracle SID | Database Database Type. If an Oracle SID, “true”, otherwise “false”. schema=Schema The database schema name. Should be a new database schema. SQLServer and Sybase customers can use “dbo”. MySQL customers must set this to the same value as “sid”. user=User The user name used to log on to the database. Should be a new login, the same as the “schema” for Oracle and DB2. MySQL customers should use “root” to eliminate permission issues with creating triggers. SQLServer and Sybase customers should not use “SA”. This user must be password authenticated. password=Password The database user password. This can be changed here, or set as an encrypted value with the command line interface using the setDbPassword script and supplying the password as the single parameter. JDBCDriver=JDBC Driver The name of the JDBC driver. protocol=Protocol The JDBC driver protocol.

o

o

o o

Relational Junction for Salesforce User Manual Page 21 of 64

Database Design
o tables pace=Data Tablespace An optional table space name for creation of tables in the schema. Depending on the DBMS used, this will affect the ability to store large rows in a given table. Use 32K block sizes if possible when creating the table space. tableSpaceIndex=Index Tablespace An optional tablespace name for creation of indexes in the schema. tableSpaceLob=LOB Tablespace An optional tablespace name for long text and binary data. Depending on the DBMS used, this will affect the ability to store large rows in a given table. Use 32K block sizes if possible when creating the tablespace. This is supported for DB2 only. dbPartitioning=Database Partitioning (true | false) Whether this is a DB2 partitioned database or not. Not relevant for other platforms. singleByte=Multi-Byte Characters (true | false) An optional parameter to turn off the triple-byte factoring of VARCHAR fields (singleByte=true). The default behavior is to triple the size of VARCHAR fields to allow for double or triple byte character sets. The space is not used unless it is needed, but tripling the size puts some fields over the limit for VARCHAR field types. This forces them to become CLOB or TEXT fields, which are somewhat more difficult to work with and slower to read or update. maxVarChar=Maximum VARCHAR Size An optional parameter to override the default limit for VARCHAR field sizes. If the length is greater than this value, a CLOB or TEXT data type will be used. This will affect the ability to store large rows in a given table, since CLOB or TEXT fields are typically not stored in the same physical record and do not count against the block size limit. Oracle 8 and 9 users should specify 1333, Oracle 10 and up and specify 4000. tablePrefix=Table Prefix Use a prefix of “T” or “SF” for all table names. This can be set to any legal value, or omitted to use non-prefixed names. customFieldSuffix=Custom Field Suffix (true | false) Allow column names for custom fields to retain the “__C” suffix (true) or not (false). globalReservedWords=DBMS-Independent Names (true | false) Check database names against all supported DBMS reserved word lists. Use this option to improve cross-platform compatibility. formulaFields=Custom Formula Fields (true | false) Most DBMS platforms will not accept insert or updates if the record does not fit into a single database block. This is not an issue for Oracle. DB2 will not even let you create the column if there is even a potential to exceed the block size. This option turns off creation and replication of all custom formula fields. This also ensures that reports do not represent out of date information if the formula is based on date-sensitive computations. downloadStrict=Objects Downloaded (Restricted | Unrestricted) (true | false) The object names will be checked against the specified downloadConfig file. o true = Each table specified must exist and no others will be added. Use this option to tightly control which tables are downloaded.

o o

o

o

o

o

o

o

o

o

Relational Junction for Salesforce User Manual Page 22 of 64

o

o

o

o

o

false = Each table specified will be checked, and only warning message will be issued if it doesn’t exist. Any tables not in the list will be added at the end in alphabetic sequence. Use this to get started or if you want the system to download all tables automatically. autoAdjustWidth=Auto Adjust Column Width (true | false) An optional parameter to turn off the automatic size adjustment of VARCHAR columns. The default is true, which will adjust column widths. If the schema is modified and this option is false, a message will appear in the log indicating that the field is smaller than the Salesforce metadata indicates. This will cause records to be rejected on most database platforms if the data does not fit the column width. downloadConfig=Download Config The name suffix of the file in the /conf directory containing the table names in order to be downloaded for -get, -getAll, -getGlobal and -getAllGlobal operations. The default config file is download.config. If this parameter is provided, the parameter will be appended to this, as in download.config.[parameter]. If a table is not visible or is turned off, comment out the line in the download config file. Any tables when exist but are not in the config file will be listed after all the named tables but will not be used. The file name itself must be of the format “download.config[suffix], where the suffix is optional. uploadConfig=Upload Config The name suffix of the file in the /conf directory containing the table names in order to be uploaded for -setGlobal operations. The default config file is upload.config. If this parameter is provided, the parameter will be appended to this, as in upload.config.[parameter]. If a table is not visible or is turned off, comment out the line in the upload config file. Any tables when exist but are not in the config file will be listed after all the named tables but will not be used. The file name itself must be of the format “upload.config[suffix], where the suffix is optional. trackHistory=Track History (true | false) Whether change history tables will be generated. If true, the prior images of any changed record will be recorded in a corresponding history table.

Salesforce Preferences
o bufferSize=Buffer Size (default 200) The number of records in a single read or update operation. The AppExchange™ API limit is a hint to the API for many operations, not an absolute limit. The default of 200 is good for most uses. If virtual memory is an issue for uploads, set this to 100, which will bring down the memory requirement from 1 GB to about 500 MB. intervalMinutes=Interval Minutes The time frame to select in the -get procedure in order to prevent timeouts. The default interval is 14400 minutes (10 days) and can be as large a value as you wish or as small a 5 minutes. In one step, the -get query will repeatedly cycle through all the time slices required to span the entire length of time since the last download. connectionTimeOut=Connection Time Out The number of minutes before automatic reconnection to Salesforce.com will be done. The default is 120 minutes.

o

o

Relational Junction for Salesforce User Manual Page 23 of 64

o

o

o

o

o o

o

o

rjTimeOut=Force Time Out Minutes (suggested values are 10 to 30 minutes) This parameter sets a limit in minutes, and will terminate jobs that are stalled due to problems with Salesforce or database I/O. The limit can be safely raised if running a long Salesforce query. The timer is reset after the initial query and for every buffer of Salesforce records retrieved. If doing a –set, it is important to determine if any new records from the buffer in process were created before the transaction was terminated, as this could cause duplicate records to be created upon rerun. For this reason, jobs that are stopped by an rjTimeOut are not automatically restarted and should not be scripted to auto restart if doing a -set unless you have a procedure to de-duplicate records after loading. threadCount=Threads (default is 1) This is the number of threads to use for –getGlobal, with each thread working on a separate object. The default is 1, but may be raised to 2, 4 or 8 threads, depending on memory and processor availability. Some networks will not support more than 1 thread, so if there are issues with NullPointerException set the value to one and run separate jobs for different objects. defaultAssignmentRule=Use Default Assignment Rule (true | false) Whether Salesforce.com Default Assignment Rules will be applied to Leads and Cases. Setting this value to “true” would turn on assignment rules, setting it to “false” would turn off assignment rules. If you want to only automatically assign new Leads or Cases, make two passes using different property files, one with defaultAssignment set to true and a filter on Lead or Case such as “lead.where=delete_flag=’I’”, and another with defaultAssignment set to false and a filter on Lead or Case such as “lead.where=delete_flag<>’I’”. triggerAutoResponseEmails=Use Default Assignment Rule (true | false) Whether AutoReponse emails will be generated when updating records in Salesforce. triggerUserEmails=Trigger User Emails (true | false) Whether User emails will be generated when updating records in Salesforce. allowFieldTruncation=Allow Field Truncation Emails (true | false) Whether Salesforce will truncate (if true) or reject the record (if false) if a text field exceeds the maximum width in Saleforce parallelUpdate=Concurrent Update (true | false) Allow other applications to update Salesforce even when performing -get operations. This mode will check for the greatest timestamp retrieved in the final time interval to ensure that any records updated during the job are retrieved the next time a replication is run. useTimeStamps=Use TimeStamps (true | false) Allow -set commands to replicate changes to Salesforce based on futuredated SYSTEMMODSTAMP values. This option is not recommended, and should be set to false, but is provided for backward compatibility.

Logging and File Locations
o logLevel=Log Level (6 is recommended) The level of logging to the debug file in the /log directory o 0 = no logging (turns off creation of the debug file) {None} o 3 = Error {Errors only} o 5 = Informational (acceptable for normal operation) {Standard}

Relational Junction for Salesforce User Manual Page 24 of 64

o o

o

o

o

o o

6 = Debug (recommended for diagnostics; includes stack traces and other information that will be required for technical support) {Debug} retainDays=Days to Retain Logs (default is 30) The number of days to keep export and log files when using the –clean command. rejectLevel=Reject Logging (default is 1) The level of logging to the export file. o 0 = no logging {None} o 1 = errors only (recommended) {Errors} o 2 = all records {All Records} fileCompression=Compress Attachments (true | false) Whether attachments loaded via convertAttachment from the file system will be compressed into zip format. attachmentFileDir=attachment Attachment Directory Directory name for attachment files which are to be loaded via the convertAttachment option. tmpFileDir=tmp Temporary File Directory The directory to store temporary work files. sqlFile=sql/rjddl.sql Generate SQL to File The file name for the DDL (data definition language) SQL statements that will be generated if the Salesforce.com schema changes. If you omit this parameter, new tables, new fields, and increases to field lengths will automatically be replicated to your database schema. It is highly recommended that you omit or comment out this parameter, or automatic schema maintenance will be turned off and replication will fail if new fields are added to Salesforce.

Notification
o mailTo= Mail to A list of email addresses delimited by commas where job log notification emails will be sent. This is optional and is frequently turned off in production, especially if jobs are run frequently. mailToException= Mail Exceptions to A list of email addresses delimited by commas where job error notification emails will be sent. This should be specified in order to know when there are problems. mailFrom=From The email address of the sending user. mailSubject=Subject: The subject line of the informational emails. mailHost=SMTP Mail Server The SMTP (outbound) mail server address. mailUser=Mail User If using a secured mail service then this is the mail user to logon as. mailPort=Port If using a secured mail service then this is the port to use for the logon. mailPassword=Password If using a secured mail service then this is the user password to use to log on with.

o

o o o o o o

Relational Junction for Salesforce User Manual Page 25 of 64

Selection Criteria
o objectName.where=Table Filters This is a query qualifier that can be modified for any table to limit what records are updated in Salesforce.com by a -set operation because of any database changes. You may remove this parameter, or change or add it for other tables, using the key word format ‘TABLENAME.where = ‘ objectName.orderBy=Table Order by If false, removes the ORDER BY clause from the selection query used in -set. Large result sets of changed records have a high overhead when sorting. If the order that these were updated is not important, set the value to “false”. This would not be a good practice for the ACCOUNT table, since parent accounts may not be present at the time a child account is modified if the child account is added first. objectName.include=Table Include Fields Limits what fields are sent to Salesforce.com by a -set operation. If this is omitted, all updateable fields are sent. The object name must be lower case and comma delimited. Multiple control records must be added for different objects. The field names are not case sensitive, but you must specific the Salesforce object name, with the trailing “__c” if it is a custom field. The fields specified will be printed in the log, and checked to insure correct spelling. objectName.exclude=Table Exclude Fields Excludes fields to be sent to Salesforce.com by a -set operation. Mutually exclusive with objectName.include for any given object. The object name must be lower case and comma delimited. Multiple control records must be added for different objects. The field names are not case sensitive, but you must specific the Salesforce object name, with the trailing “__c” if it is a custom field. The fields specified will be printed in the log, and checked to insure correct spelling.

o

o

o

Relational Junction for Salesforce User Manual Page 26 of 64

Example DB2 Configuration
See conf/rj4salesforce.properties.db2:
#Relational Junction for Salesforce Properties licenseKey= licenseKey2= sfdcUser= sfdcPassword= connectUrl= http.proxyHost= http.proxyPort= http.proxyUser= http.proxyPassword= dbms=DB2 JDBCDriver=com.ibm.db2.jcc.DB2Driver protocol=jdbc:db2 host= port=50000 database= sid=false schema= user= password= tableSpace= tableSpaceIndex= tableSpaceLob= dbPartitioning= singleByte=true autoAdjustWidth=false maxVarChar=255 tablePrefix=T customFieldSuffix=false globalReservedWords=true formulaFields=true downloadConfig=download.config downloadStrict=false uploadConfig=upload.config trackHistory=false parallelUpdate=false bufferSize=200 connectionTimeOut=120 rjTimeOut=10 intervalMinutes=144000 defaultAssignmentRule=false exportFileDir=export rejectLevel=1 attachmentFileDir=attachment fileCompression=false tmpFileDir=tmp sqlFile= logLevel=6 retainDays=30 mailto= exception= subject=Relational Junction Job Output from= smtp= lead.where=coalesce(ISCONVERTED,'false') = 'false'

Relational Junction for Salesforce User Manual Page 27 of 64

Example MySQL Configuration
See conf/rj4salesforce.properties.mysql:
#Relational Junction for Salesforce Properties licenseKey= licenseKey2= sfdcUser= sfdcPassword= connectUrl= http.proxyHost= http.proxyPort= http.proxyUser= http.proxyPassword= dbms=MySql JDBCDriver=com.mysql.jdbc.Driver protocol=jdbc:mysql host= port=3306 database= sid=false schema= user= password= tableSpace= tableSpaceIndex= tableSpaceLob= dbPartitioning=false singleByte=false maxVarChar=255 tablePrefix=T customFieldSuffix=false globalReservedWords=true formulaFields=true downloadConfig=download.config downloadStrict=false uploadConfig=upload.config trackHistory=false parallelUpdate=false bufferSize=200 connectionTimeOut=120 rjTimeOut=10 intervalMinutes=14400 defaultAssignmentRule=false exportFileDir=export rejectLevel=1 attachmentFileDir=attachment fileCompression=false tmpFileDir=tmp sqlFile= logLevel=6 retainDays=30 mailto= exception= subject=Relational Junction Job Output from= smtp= lead.where=coalesce(ISCONVERTED,'false') = 'false'

Relational Junction for Salesforce User Manual Page 28 of 64

Example Oracle Configuration
See conf/rj4salesforce.properties.oracle:
# Relational Junction for Salesforce Properties licenseKey= licenseKey2= sfdcUser= sfdcPassword= connectUrl= http.proxyHost= http.proxyPort= http.proxyUser= http.proxyPassword= dbms=Oracle JDBCDriver=oracle.jdbc.driver.OracleDriver protocol=jdbc:oracle:thin host= port=1521 database= sid=true schema= user= password= tableSpace= tableSpaceIndex= tableSpaceLob= dbPartitioning=false singleByte=false maxVarChar=1330 tablePrefix=T customFieldSuffix=false globalReservedWords=true formulaFields=true autoAdjustWidth=true downloadConfig=download.config downloadStrict=false uploadConfig=upload.config trackHistory=false parallelUpdate=false bufferSize=200 connectionTimeOut=120 rjTimeOut=10 intervalMinutes=14400 defaultAssignmentRule=false exportFileDir=export rejectLevel=1 attachmentFileDir=attachment fileCompression=false tmpFileDir=tmp sqlFile= logLevel=6 retainDays=30 mailto= exception= subject=Relational Junction Job Output from= smtp= lead.where=coalesce(ISCONVERTED,'false') = 'false'

Relational Junction for Salesforce User Manual Page 29 of 64

Example PostgreSQL Configuration
See conf/rj4salesforce.properties.postgresql:
#Relational Junction for Salesforce Properties licenseKey= licenseKey2= sfdcUser= sfdcPassword= connectUrl= http.proxyHost= http.proxyPort= http.proxyUser= http.proxyPassword= dbms=PostgreSQL JDBCDriver=org.postgresql.Driver protocol=jdbc:postgresql host= port=5432 database= sid=false schema= user= password= tableSpace= tableSpaceIndex= tableSpaceLob= dbPartitioning=false singleByte=false maxVarChar=256 tablePrefix=T customFieldSuffix=false globalReservedWords=true formulaFields=true autoAdjustWidth=true downloadConfig=download.config downloadStrict=false uploadConfig=upload.config trackHistory=false parallelUpdate=false bufferSize=200 connectionTimeOut=120 rjTimeOut=10 intervalMinutes=14400 defaultAssignmentRule=false exportFileDir=export rejectLevel=1 attachmentFileDir=attachment fileCompression=false tmpFileDir=tmp sqlFile= logLevel=6 retainDays=30 mailto= exception= subject=Relational Junction Job Output from= smtp=

Relational Junction for Salesforce User Manual Page 30 of 64

Example SQL Server Configuration
See conf/rj4salesforce.properties.sqlserver:
#Relational Junction for Salesforce Properties licenseKey= licenseKey2= sfdcUser= sfdcPassword= connectUrl= http.proxyHost= http.proxyPort= http.proxyUser= http.proxyPassword= dbms=SQLServer JDBCDriver=com.inet.tds.TdsDriver protocol=jdbc:inetdae7 host= port=1433 database= sid=false schema=dbo user= password= tableSpace= tableSpaceIndex= tableSpaceLob= dbPartitioning=false singleByte=false maxVarChar=1000 tablePrefix=T customFieldSuffix=false globalReservedWords=true formulaFields=true autoAdjustWidth=true downloadConfig=download.config downloadStrict=false uploadConfig=upload.config trackHistory=false parallelUpdate=false bufferSize=200 connectionTimeOut=120 rjTimeOut=10 intervalMinutes=14400 defaultAssignmentRule=false exportFileDir=export rejectLevel=1 attachmentFileDir=attachment fileCompression=false tmpFileDir=tmp sqlFile= logLevel=6 retainDays=30 mailto= exception= subject=Relational Junction Job Output from= smtp= lead.where=coalesce(ISCONVERTED,'false') = 'false' lead.orderBy=false

Relational Junction for Salesforce User Manual Page 31 of 64

Example Sybase Configuration
See conf/rj4salesforce.properties.sybase:
#Relational Junction for Salesforce Properties licenseKey= sfdcUser= sfdcPassword= connectUrl= http.proxyHost= http.proxyPort= http.proxyUser= http.proxyPassword= dbms=Sybase JDBCDriver=com.sybase.jdbc3.jdbc.SybDriver protocol=jdbc:sybase:Tds host= port=5000 database= sid=false schema= user= password= tableSpace= tableSpaceIndex= tableSpaceLob= dbPartitioning=false singleByte=false maxVarChar=765 tablePrefix=T customFieldSuffix=false globalReservedWords=true formulaFields=true downloadConfig=download.config downloadStrict=false uploadConfig=upload.config trackHistory=false parallelUpdate=false bufferSize=200 connectionTimeOut=120 rjTimeOut=10 intervalMinutes=14400 defaultAssignmentRule=false exportFileDir=export rejectLevel=1 attachmentFileDir=attachment fileCompression=false tmpFileDir=tmp sqlFile= logLevel=6 retainDays=30 mailto= exception= subject=Relational Junction Job Output from= smtp= lead.where=coalesce(ISCONVERTED,'false') = 'false' lead.orderBy=false

Relational Junction for Salesforce User Manual Page 32 of 64

Managing your Warehouse
Operational Considerations
Relational Junction for Salesforce is comprised of the RJ4Salesforce shell or batch script and a java program that replicates data to and from Salesforce.com to a local database. Data is copied from one or more Salesforce objects into local database tables. This process uses the current AppExchange™ SOAP API to access Salesforce.com data, with all its power and limitations, including:  Data view and update ability based on role of authenticating user account  SOAP interface limited to updating 200 records per buffer  SOAP interface throughput speed limitations (approximately 40 to 150 records per second; your mileage may vary)  SOAP interface timeout limited to 8 hours per connection, depending on your site’s settings. Relational Junction for Salesforce will normally reconnect before that limit is reached, allowing long-running jobs to complete.  SOAP interface being subject to internet connection reliability, and occasional disconnects. Relational Junction for Salesforce has built-in retry logic to reconnect in the event of a timeout or disconnect. Data is inserted or updated directly into the database without intermediate data files. It is read from the S alesforce.com site with incremental filtering by date stamp, and "upserted" (inserted, or updated if existing). Throughput is typically limited by the SOAP interface rather than local database performance, providing that there is ample virtual memory on the client machine. There are four download methods and one upload method:  getAll -- Download the entire Salesforce object (table). In general, this should only be used for objects with very few records, and only once for the initial load, as it is not restartable and will time out when there are over one million records.  get -- Download all records of a Salesforce object since the organization was created, and do incremental replication since the initial load. This is assisted by intelligent tracking of run dates per object and automatically calculating the timeframe for a download. This is a scalable method for large organizations to load their warehouse the first time, since it segments the load to prevent Salesforce.com timeouts and is restartable at the point in time of failure.  getByQuery -- Download by query. Similar to –get, except that you can create a SOQL query in a control file in rj4salesforce/data which will filter records based on SQL-like selection criteria. The name of the file must be objectName.soql or objectName.config.soql where objectName is the Salesforce config  getByID – Download records for a given object by Salesforce ID. Create a control file in rj4salesforce/data of Salesforce 18-byte record keys for specific record retrieval. The name of the file must be objectName.id, where objectName is the Salesforce object name.  set -- Upload updated, inserted, or logically deleted records. o Create new records where DELETE_FLAG = ‘I’ (insert) or ‘R’ (recover). Upon successful record creation in Salesforce the DELETE_FLAG will be changed to ‘N’ and populated with the new Salesforce ID. Additionally, all relationship fields in related objects will be updated to

Relational Junction for Salesforce User Manual Page 33 of 64

o o

o

reflect the new ID, allowing you to send the child records to Salesforce in a subsequent -set command. Update all records where DELETE_FLAG = ‘U’. After the update, DELETE_FLAG will be set to ‘N’. Update all records having SYSTEMMODSTAMP greater than the last download time for the given Salesforce object. This option requires that any code that updates the database also set the SYSTEMMODSTAMP to a future GMT (UTC) value before uploading. Setting DELETE_FLAG to ‘U’ is highly preferable to the SYSTEMMODSTAMP technique, as restarted jobs will not reprocess the same records as they would if using time stamps to control updates. Delete records in Salesforce.com where DELETE_FLAG = ‘D’ (delete). Changes DELETE_FLAG to ‘Y’ after the delete.

History Tracking
Purpose and Limitations of History Tracking
The history tracking feature provides an audit trail of all Salesforce-initiated changes to records. The -getAll, -get, -getByQuery, and -getByID options use common logic to insert to the related history table before updating records. This functionality is implemented entirely in replication code. Changes from mass updates of a table via SQL or integration processes will not be recorded. Changes from Salesforce.com during Salesforce release upgrades are also ignored by virtue of a unique index on ID and LASTMODIFIEDDATE.

History Table Schema Creation and Modification
The getSchema routine is called transparently every time a replication is performed in order to validate and modify if necessary the database table that corresponds to the given Salesforce object. If history tracking is turned on via the TrackHistory configuration option, a history table will also be created with the same columns. The history table will be named X[table], where [table] is a substring of the base table name starting in position 2 if the tablePrefix property is null, or starting after the table prefix if the tablePrefix property is specified.

Relational Junction for Salesforce User Manual Page 34 of 64

Runtime Options
Replication is invoked from the RJ4Salesforce.bat Windows batch script or RJ4Salesforce UNIX shell script. An RJ4Salesforce.ksh script is provided for Korn shell UNIX systems, typically Sun Solaris. The following command line options can be stacked into a single job, or separated into separate operations. If you wish to operate on more than one table with the same command option, you must repeat the command option.

-config suffix
Use a named configuration. Parallel jobs can be run only if each uses its own configuration. Parameters:  Suffix for the rj4salesforce.conf file name, as in rj4salesforce/conf/rj4salesforce.properties.suffix

-setDbPassword password
Set database password. The password will be stored in the properties file using 128-bit encryption. You may also enter the password directly into the rj4salesforce.properties file in plain text, and Relational Junction will encrypt it on first use. Parameters:  Database password

-setSfdcPassword password
Set Salesforce.com password. The password will be stored in the properties file using 128-bit encryption. You may also enter the password directly into the rj4salesforce.properties file in plain text, and Relational Junction will encrypt it on first use, or in the web user interface. Parameters:  Database password

-getSchema objectName
Get Salesforce.com schema description for a named object, and create the table and columns in the database if missing. This is implicitly called by all other commands without printing the results. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getSchemaGlobal
Print all Salesforce.com schema descriptions, and create tables in the database. Parameters:  None

Relational Junction for Salesforce User Manual Page 35 of 64

-getAll objectName
Get all records for a named Salesforce object. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getAllGlobal
Get all records for all Salesforce objects. Parameters:  None

-getDeleted objectName
Compare all records for a named Salesforce object to the database, delete records that are no longer in Salesforce and add any records that are not in the database. This should be run only if you suspect that the normal replication has missed deleted records due to infrequent synchronization or massive deletes, as the recycle bin has a fairly small capacity. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getDeletedGlobal
Compare all records for a all Salesforce object to the database, delete records that are no longer in Salesforce, and add any records that are not in the database. This should be run only if you suspect that the normal replication has missed deleted records due to infrequent synchronization or massive deletes, as the recycle bin has a fairly small capacity Parameters:  None

-audit objectName
Combines –get and –getDeleted options. After a –get, the –getDeleted should normally show no records deleted, added, or updated. This process verifies that a table is in perfect synch with Salesforce. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-auditGlobal
Combines –get and –getDeleted options for all tables. After a –get, the –getDeleted should normally show no records deleted, added, or updated. This option should be used weekly to ensure that all deleted records are flagged and guarantee that the database is in perfect synch with Salesforce

Relational Junction for Salesforce User Manual Page 36 of 64

Parameters:  None

-get objectName
Copy all changed records for a named Salesforce object to the database since the last retrieval. This is limited to changes within the last 29 days. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getGlobal
Copy all records for all Salesforce objects to the database since the last retrieval. This is limited to changes within the last 29 days. Parameters:  None

-getById objectName
Get selected records for a given objects by ID. The ID file must be in the rj4salesforce/data directory as object.id and contains the desired ID's of the appropriate object as separate records in the control file. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getByQuery objectName
Get selected records for a given objects by SOQL query. The query file must be in the rj4salesforce/data directory as objectName.config.soql or object.soql and contains the soql selection clause for the appropriate object, where config is the suffix of the rj4salesforce.properties file. If omitting the config name, any configuration can use the SOQL query in a -getByQuery operation. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-set objectName
Update Salesforce.com for a single table where DELETE_FLAG = ‘U’ or SYSTEMMODSTAMP is after the last time each table was retrieved to the database. Create new records in Salesforce.com Salesforce.com where DELETE_FLAG = ‘I’ (insert) or ‘R’ (recover). Delete records in Salesforce.com where DELETE_FLAG = ‘D’. Parameters:  Salesforce Object Name (Account, Lead, etc.)

Relational Junction for Salesforce User Manual Page 37 of 64

-setGlobal
Update objects in Salesforce.com in the order specified by rj4salesforce/conf/upload.config, or a suffixed version as specified in the properties file Parameters:  None

-getRealTime
Search the RJ_OUTBOUND_MESSAGE table for items needing real time replication. Grouping by object name, perform the replication and remove from the RJ_OUTBOUND_MESSAGE table if the replication is successful and no other transactions have updated the same record. Parameters:  None

-repeat [second delay]
-repeat will perform subsequent operands in a cycle forever, delaying the cycle by the specified number of seconds each time. The default is 30 second delay. Parameters:  Seconds to delay between repeat cycles

-convertAttachment
Load Attachments from the file system referenced by attachmentFileDir (defaults to rj4salesforce/attachment) for each Attachment table entry where DELETE_FLAG = ‘C’ (new) or ‘R’ (replace). The Body column will contain the actual Attachment content. BodyLength will be set to the actual length of the content. DELETE_FLAG will be set to set to ‘I’ for new or ‘U’ for updates in preparation to load the Attachments to Salesforce. The Name column can reference a subdirectory; the subdirectory name will be removed from the Name after the Attachment is loaded to the table. If the fileCompression property is set to “true”, the attachment will be zipped before it is loaded to the Attachment table. This option will save space in Salesforce but take an additional step in extracting the Attachment when viewing in Salesforce. Follow this step with –set Attachment Parameters:  None

-convertDocument
Load Documents from the file system in rj4salesforce/document for each Document table entry where DELETE_FLAG = ‘C’ (new) or ‘R’ (replace). The Body column will contain the actual Attachment content. BodyLength will be set to the actual length of the content. DELETE_FLAG will be set to ‘I’ for new or ‘U’ for updates in preparation to load the Documents to Salesforce. The Name column can reference a subdirectory; the subdirectory name will be removed from the Name after the Document is loaded to the table. Relational Junction for Salesforce User Manual Page 38 of 64

If the fileCompression property is set to “true”, the attachment will be zipped before it is loaded to the Attachment table. This option will save space in Salesforce but take an additional step in extracting the attachment when viewing in Salesforce. Follow this step with –set Document. Parameters:  None

-convertLead
Convert all leads where DELETE_FLAG = ’C’. The leads must already exist in Salesforce. The LeadStatus field must be a legal status for a converted lead. Parameters:  None

-convertRTF objectName
Convert database RTF text to plain text. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-merge objectName
Merge Leads, Accounts, or Contacts. Set DELETE_FLAG to ‘M’ for records you wish to merge, and set the MasterRecordID to the ID of the “surviving” record. The records to merge will be deleted from Salesforce, their DELETE_FLAG set to ‘Y’, and all the related records and relationships set to that of the master record. Parameters:  Salesforce Object Name (Lead, Account, Contact)

-getReference objectName
Get Salesforce.com pick list values for a named object, and populate the values into the VALUE column of the RJ_REFERENCE table, using the OBJECT_NAME and FIELD_NAME as the key. This table can be used to populate pick lists in a custom application or as selection criteria in a reporting system. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getReferenceGlobal
Get Salesforce.com pick list values for all objects and create entries in the RJ_REFERENCE table. Parameters:  None Relational Junction for Salesforce User Manual Page 39 of 64

-getIndex objectName
Create foreign key indexes for one parent object. All objects pointed to by this object will have indexes built on their logical foreign key fields. This is important to support reporting or integration triggers. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getIndexGlobal
Create foreign key indexes for all objects. Parameters:  None

-getTrigger objectName
Create integration trigger for one object. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-getTriggerGlobal
Create integration triggers for one objects. Parameters:  None

-reset objectName
Remove all history for this object in the RJ_History table. This will enable a complete refresh using –get. If you suspect that there are untracked deletes, you may then run a – getDeleted command. RJ4Salesforce –reset [object] –get [object] –getDeleted [object] Parameters:  Salesforce Object Name (Account, Lead, etc.)

-resetGlobal
Remove all history for all objects in the RJ_History table. This will enable a complete refresh of the database using –getGlobal. If you suspect that there are untracked deletes, you may then run a –getDeleted command to capture any deletes within the last 30 days. RJ4Salesforce –reset [object] –get [object] –getDeleted [object] Parameters:  Salesforce Object Name (Account, Lead, etc.)

Relational Junction for Salesforce User Manual Page 40 of 64

-dropTable objectName
Drop a table from the local database. The object must be deleted from Salesforce or hidden though security prior to deleting it from the local database. If you delete the table with a sql “DROP TABLE” command, replication will rebuild it and reload it completely by a -get command Parameters:  Salesforce Object Name (Account, Lead, etc.)

-dropColumn objectName fieldName
Drop a column from the local database. The column must be deleted from Salesforce or hidden by security prior to deleting it from the local database. Parameters:  Salesforce Object Name (Account, Lead, etc.)  Salesforce Field Name

-checkGlobal
Check whether each object specified in the download.config file used actually exists in Salesforce. Also checks whether the upload.config file is in parent-child order. Finally, this option will create the metadata for all objects in order to select what objects are available for selective replication. Parameters:  None

-checkSchema objectName
Check whether each column in the local database has a corresponding field in Salesforce. Use this to determine what columns have been deleted from Salesforce in order to clean up your local database with the dropColumn command. Parameters:  Salesforce Object Name (Account, Lead, etc.)

-checkSchemaGlobal
Check whether each column of all tables in the local database has a corresponding field in Salesforce. Use this to determine what columns have been deleted from Salesforce in order to clean up your local database with the dropColumn command. See checkSchema. Parameters:  None

Relational Junction for Salesforce User Manual Page 41 of 64

-clean
Remove all files and empty directories in the log and export directories that are older than the number if days specified in the retainDays property. Remove all files in the rj4salesforce/tmp directory older than 20 minutes. Remove RJ_HISTORY records older than 60 days. Parameters:  None

-cleanTemp
Remove all files in the rj4salesforce/tmp directory older than 20 minutes. Parameters:  None

-build
Build a new database. Calls  -getSchemaGlobal  -getTriggerGlobal  -getIndexGlobal  -getGlobal  -getReferenceGlobal Parameters:  None

Forced Termination of a Job
If you kill a job with CTRL-C or close the window, it leaves a rj4salesforce.run.default file in the rj4salesforce/data directory, which acts as a semaphore that the RJ4Salesforce script checks. This results in the following error message: "Prior job has not completed, terminating" Remove the rj4salesforce.run.default file. If you specified the “-config” option, the name of the file would end in whatever config is used instead of “.default”. To keep this from happening again on a Windows machine, when you CTRL-C, answer "N" to the prompt: C:\RelationalJunction\rj4salesforce\bin>rj4salesforce <CTRL-C> Terminate batch job (Y/N)? N

Relational Junction for Salesforce User Manual Page 42 of 64

Real Time Option Implementation 
What is RTO? 
Relational Junction for Salesforce Real Time Option is a feature that allows replication of specific objects in real time, both from Salesforce to the database and from the database to Salesforce.

Previously, Salesforce data replication was a batch process, with scheduled replication cycles polling upward of 200 Salesforce objects for changes. Meanwhile, reporting users are waiting for the changes to show up in the local database. Customer service users are waiting for customer-generated cases to show up in Salesforce. Trust is lost in the accuracy of stale data. The days when a reporting database could be refreshed on a nightly basis are over. Users want up-to-the-minute accuracy of their data.

What are the limitations?
Not a whole lot. Relational Junction for Salesforce now provides an option for replication of all fields from Salesforce.com to a local database for Account, Asset, Campaign, Campaign Member, Case, Case Comment, Contact, Contract, Event, Idea, Opportunity, OpportunityLineItem, Query, Site, Solution, Task and all custom objects. Salesforce.com Outbound Messaging is used to drive replication of changed Salesforce data. There are no API calls made if there are no changes. Real Time replication from the replicated database to Salesforce is supported for all standard and custom objects.

What is an RTO replication cycle? 
Replication can be either from Salesforce or to Salesforce. A replication cycle is controlled by running Relational Junction for Salesforce replication via a -repeat command option with an optional wait interval, such as: RJ4Salesforce config prod -repeat 10 -getRealTime – setGlobal This would get changed records from Salesforce, send database updates to Salesforce, wait 10 seconds, and start the whole process over.

How does RTO work for downloads? 
Salesforce Outbound Messaging is configured in Salesforce to send the Salesforce ID and SYSTEMMODSTAMP fields to a web services application on your server whenever records are changed. The web services application supplied by Sesame Software as an optional component listens for the messages, and inserts or updates a record in the RJ_OUTBOUND_MESSAGE database table with the ID and SYSTEMMODSTAMP.

Relational Junction for Salesforce User Manual Page 43 of 64

Relational Junction for Salesforce creates a mapping of the first four characters of the ID fields in all database tables via the new getObjectIdMapGlobal command option, saving the results in the RJ_OBJECT_ID_MAP table. This eliminates the need for custom code for each Salesforce object in the web services application. The -getObjectIdMapGlobal command is run only when the database is built, eliminating overhead during real time execution. Relational Junction for Salesforce has a new -getRealTime command option that searches the RJ_OUTBOUND_MESSAGE table for activity, grouping by object
type. The first four characters if the ID is matched with the RJ_OBJECT_ID_MAP table to determine the groupings. A file of the ID’s is created for each group in the rj4salesforce/data directory, and passed to the -getByID command option for processing of the full records from Salesforce. There is only one metadata call in the entire lifetime of the job execution, unless there is an error, in which case the restart logic checks the database against Salesforce.com for consistency. If there is no data to be replicated in a real time replication cycle, there are no API calls.

How does RTO work for uploads? 
When in real-time mode, the -set and -setGlobal command options have been optimized to count records in each table specified that are marked for sending to Salesforce by their DELETE_FLAG being set to U, I, or D (update, insert, or delete). If there are no records to send, the overhead of metadata lookups is eliminated, and there are no API calls.

Installation and Setup 
Unzip the rjobm.zip file in your tomcat webapps directory. Navigate to <tomcat webapps path>rjobm\WEB-INF\classes\db\domain and edit the hibernate.cfg.xml file with the databse username and password for your database setup.
<property name="hibernate.connection.url"> jdbc:mysql://localhost:3306/(databasename) </property> <property name="hibernate.connection.username"> (username) </property> <property name="hibernate.connection.password"> (Password) </property>

Restart Tomcat to start the service. To test whether the service is running open your browser and navigate to this url

Relational Junction for Salesforce User Manual Page 44 of 64

http://localhost:8080/rjobm/services. you should see the following displayed.

Now that the service is setup you will need to setup the out bound messages. For this you will have to login to your Salesforce instance. And go to setup.

On the left hand column open create then Workflows& Approvals and select workflows.

Relational Junction for Salesforce User Manual Page 45 of 64

Click the button that says new rule

Select the object that you want real time replication turned on. You will need to make a separate workflow and outbound message for each object you want replicated in real

time.

Relational Junction for Salesforce User Manual Page 46 of 64

Give the rule a unique name and select how you want the rule evaluated. For real time option we recommend the third option (Every time a record is created or edited).

In the bottom of the page you will set what will trigger the workflow this can be set to whatever your criteria that meets your requirements. For example if you want every record replicated in real time, you can set a field like account name which is a required

field as not equal to null. Click save and next. On sep 3 we want to set up a New Outbound Message.

Relational Junction for Salesforce User Manual Page 47 of 64

Name the outbound message. The unique name will automatically be filled in but you can change this if you wish. The end point is the service you set up earlier. This will be http://<url to your site>:8080/rjobm/services/Notification. User will be prefilled in but can be changed. Session Id is not necessary so leave unchecked. On the field to send ID is already there you will need to add the

SystemModstamp. Save the out bound message. Activate the work flow and you are complete. Again you will need to repeat this process for each of the objects you want for real time option.

Relational Junction for Salesforce User Manual Page 48 of 64

Best Practices
Incremental vs. Full Download
The standard technique to keep your database in synch with your Salesforce.com site is to take a full copy of all Salesforce objects once with a -build command, then run incremental copies of all tables every 5 to 60 minutes with a -getGlobal command. If you run -get on an object, it will automatically do a full copy the first time. -get will go back to the beginning of time for your organization and load tables in date rates. The intervalMinutes parameter determines the number of days in each time segment (1440 = 1 day), and is dynamically adjusted to consider the number of records in the prior interval. We suggest that you set intervalMinutes to 14400 and load 10 days at a time in an interval. There are no referential integrity constraints in the database, for the following reasons:
 

Replications could fail on constraint violations if child records were loaded before parents The Salesforce.com application constraints are sometimes not possible to implement in a relational database. A single column can sometimes point to several possible targets It would not be possible to replicate new parent objects and keep the relationship fields updated when Salesforce.com creates the new parent ID.

Frequency of Replication
There are potential issues with infrequent replication.  If the replication is run only once a day and the job fails for any reason, it must be manually restarted or delayed for a full day. Since incremental replication is a very efficient process, it is better to replicate more frequently than this.  Deleted records in Salesforce may not be properly flagged in the database. There is a “sweeper” program at Salesforce.com that physically deletes records if the recycle bin is “full” or is emptied. This program is run roughly every two hours. Its selection criteria tend to be indeterminate to the outside observer. If records that are marked for deletion are physically deleted by the sweeper, the API will raise an exception if records in that time span are requested by a getDeleted( ) API call, which is performed internally and handled gracefully by the -get option. We strongly recommend running replications at least once per hour to eliminate the possibility of this problem arising. You may run an auditGlobal option weekly to synch up any new, changed, or deleted records that did not get captured by normal replication for whatever reason.

Upload of New, Changed, and Deleted Records
The technique to keep your Salesforce.com site in synch with changes made to your database is -set. There are three separate use cases: o New records are identified by an ‘I’ in the DELETE_FLAG. These are always created in Salesforce.com, unless the record fails Salesforce.com edits. These edits include required field tests, legal values, valid email addresses, and valid ID values of related objects and parent records. The Salesforce.com ID is populated and the DELETE_FLAG is set to ‘N’ after the record is created.

Relational Junction for Salesforce User Manual Page 49 of 64

o

o

Changed records are identified by having DELETE_FLAG = ‘U’ or a SYSTEMMODSTAMP greater than the start time of the last download for that object (if the useTimestamps option is set to true). You would set SYSTEMMODSTAMP to a date later than QUERY_START_DATE in RJ_HISTORY for this table where the JOB_TYPE in RJ_HISTORY = ‘Download’. Note that timestamps updated by integrations must be stored in UTC (GMT), not local time, for this to work. Using DELETE_FLAG=’U’ is easier than setting timestamps and is recommended to avoid reprocessing records in the event of a restart. Records that are to be deleted in Salesforce.com must have a DELETE_FLAG value of ‘D’. The DELETE_FLAG is changed to ‘Y’ after the delete is successful. Records must not be physically deleted in your database; they are logically deleted instead.

Canceling a -set job in progress via CTRL-C or getting timed by a hung transaction that exceeds the rjTimeOut limit will potentially create new records without setting their Salesforce ID’s or DELETE_FLAGs. This can cause duplicate records in Salesforce. Instead of CTRL-C, remove the associated rj4salesforce.run.xxxxx file in rj4salesforce/data and within a few seconds the job will terminate cleanly.

Recovery of Deleted Record Structures
If you wish to recover an entire Account structure for a deleted Account, Relational Junction supports this via a following procedure:      run -getTriggerGlobal to build recovery triggers run -getIndexGlobal to build supporting indexes Query Account where DELETE_FLAG = Y (Deleted) Set DELETE_FLAG for chosen Account to ‘R’ (recover) Set OpportunityLineItem set totalprice = null for that record -- Salesforce wants either the unit price or the total price to be null for new records: UPDATE TOPPORTUNITYLINEITEM SET TOTALPRICE = NULL WHERE DELETE_FLAG IN ('R','I')  Update Partner table to eliminate bi-directional relationships and redundant opportunity-account data that would prevent creation in Salesforce UPDATE TPARTNER P SET DELETE_FLAG = 'X' WHERE DELETE_FLAG IN ('I','X') AND EXISTS (SELECT 1 FROM TOPPORTUNITY O WHERE O.ID = P.OPPORTUNITYID AND O.ACCOUNTID = P.ACCOUNTTOID); UPDATE TPARTNER P SET ACCOUNTFROMID = NULL WHERE OPPORTUNITYID IS NOT NULL AND DELETE_FLAG = 'I'

Relational Junction for Salesforce User Manual Page 50 of 64

   

Create a new upload.config file with the entire Account structure in hierarchical order named something like upload.config.recover. Create a new RJ4Salesforce configuration file named something like recover and set its Upload Config property to the file you created above, such as, upload.config.recover. Run –setGlobal with the configuration file you just created, such as, -config recover –setGlobal. If Salesforce rejects records for any reason, review the error message to determine corrective action and rerun –setGlobal. Not all tables can be reloaded to Salesforce, including History.

Loading Very Large Warehouses
Salesforce.com will typically time out a request for more than one million records in a getAll. The technique to load very large organizations is:

Set intervalMinutes in your rj4salesforce.properties file to a reasonable size for your database. A value of 14400 (which is 10 days, in minutes) or larger would get you a set of records for each time period that long since your Salesforce org was created. The interval is dynamically adjusted based on how many records were returned in the prior interval. We determine the starting date from the CREATEDDATE in the Organization object, so load that one first. Run the following: RJ4Salesforce –getAll Organization -getGlobal

This will retrieve all data from Salesforce. If it crashes for any reason, it will automatically redo the recent changes only from the first tables in the list, then pick up where it left off from the table where it crashed. Certain Salesforce objects, such as OpportunityHistory, do not have indexes to facilitate the timestamp-based full download. The queries take longer, but the process is restartable. get will invoke getAll internally if the object is not queryable by timestamp.

Uploading in Hierarchical Order
-set requires that tables are loaded in hierarchical sequence. For instance, new Accounts must be loaded before Contacts, because there is a parent relationship to the Account in the Contact. To facilitate this, the setGlobal technique utilizes the upload.config file, which may be customized to add or remove tables (or comment them out with a # in the first character of any line). The default upload.config file provides the natural order of the parent-child relationships, although there are several other sequences that would also work. The checkGlobal command will check the order of the upload.config objects and warn you if there are potential problems. In some cases, recursive relationships may require that you load both tables, then build the relationships in a subsequent step. The PARENTID field of the Account object is one such relationship; you cannot populate the PARENTID unless the parent account that it refers to actually exists. Therefore, you would need to create al the accounts and then update their PARENTID’s.

Relational Junction for Salesforce User Manual Page 51 of 64

Individual records in some tables must also be uploaded in a certain order. Accounts can have parent Accounts, which means that the parents must be loaded first. You could accomplish this by uploading all Accounts, then uploading again to catch the child accounts that failed the first upload due to missing parents. You will know you’re done when no Accounts have null ID fields in your database.

Pre-Populating Foreign Keys
If you are creating records directly in your database in order to replicate them to Salesforce, there are a number of tables that have foreign key values that must be prepopulated. For instance, the Contact table has an ACCOUNTID field, which is the ID of the Account. Since the ID of a new Account is created by Salesforce when it is replicated to Salesforce, the Account ID might not yet be populated when you create the contact. One resolution is as follows: o Create the Account. If there is a unique identifier from the source system, create a LEGACY_ACCOUNTID custom field on the account. o Create the Contact. Store the Account’s LEGACY_ACCOUNTID on the Contact as a custom field. o Write an Update trigger on the Account table that does this (Oracle PL/SQL is given as an example):
if :old.ID is null and :new:ID is not null update TCONTACT C set C.ACCOUNTID = :new.ID where C.LEGACY_ACCOUNT_ID = :new.LEGACY_ACCOUNTID; end if;

:old and :new refer to the previous image of the TACCOUNT table record. This is the Oracle PL/SQL trigger convention. You will want to put a non-unique index on LEGACY_ACCOUNTID in the TCONTACT table for performance reasons.

Managing Tables that are not Replicateable
There are a number of tables that are not “replicateable”, meaning that timestamps are not tracked by the standard API interface. o o o o o o o o o o o o o AccountShare AssignmentRule BusinessHours BusinessProcess CaseStatus ContractStatus CurrencyType EventAttendee Folder LeadStatus MailmergeTemplate OpportunityHistory OpportunityShare Relational Junction for Salesforce User Manual Page 52 of 64

o o o o o o o o o o

OpportunityStage PartnerRole Profile RecordType Scontrol SolutionStatus TaskPriority TaskStatus UserRole WebLink

Updates to these tables are generally handled automatically by the -get command. Deletes are tracked via a queryAll API call with inspection of the isDeleted field, and subsequently by a getDeleted( ) API call. There are reported instances of record deletes that are not tracked by Salesforce.com. Run -audit or -auditGlobal on a weekly basis on these tables to check for deltas and flag these with DELETE_FLAG=’Y’. This does a complete dump of all ID’s and timestamps to a temporary table to compare the base table with the current record set, and syncs any discrepancies.

Tracking Deletes and Record Status
Instead of physically deleting records in your database, there is a DELETE_FLAG column in every table that is not a Salesforce.com field, but is used to track and manage delete processing by Relational Junction for Salesforce. o ‘N’ indicates this is an active record o ‘Y’ indicates the record was deleted in Salesforce o ‘D’ can be set by your integration code to tell Relational Junction for Salesforce to delete the record the next time a -set (upload) operation is performed on this table. This value will be changed to ‘Y’ after the record is deleted. o ‘U’ can be set by your integration code to tell Relational Junction for Salesforce to update the record the next time a -set (upload) operation is performed on this table. This value will be changed to ‘N’ after the record is updated. o ‘I’ indicates a new record. A new record can also be identified by having a null ID. This causes duplicate constraint violations in some DBMS implementations, so one would pre-populate the ID with a unique value and set the DELETE_FLAG to ‘I’ instead of relying on a null ID. o ‘R’ indicates a new record that will be recovered with its entire structure (Accounts, Contacts, Opportunities, etc.). o ‘C’ indicates a Lead that is to be converted to an Account, Contact, and Opportunity via the –convertLead option. If CONVERTEDACCOUNTID, CONVERTEDCONTACTID, or CONVERTEDOPPORTUNITYID are set to the ID of existing Account, Contact, and Opportunity records, they will be used. The Lead must already exist in Salesforce.com. Relational Junction does not create new opportunities, but will point to existing opportunities. You must also set the STATUS to a value that is allowed for a converted lead. o ‘M’ indicates a request to merge an Account, Contact, or Lead into another one as indicated in the MasterRecordID field.

Relational Junction for Salesforce User Manual Page 53 of 64

Mass Changing Records in Salesforce
Mass changes of records in Salesforce will cause the same changes in your database, except that this is done through replication of every field in the changed records, instead of direct update. Therefore, if you change pick list values for 100,000 records in a table, replication is going to be a lengthy process.

Relational Junction for Salesforce User Manual Page 54 of 64

Architectural Limits
Use of Reserved Words for Field Names
There are reserved words that cannot be used for database table or column names in each DBMS. All Salesforce objects become tables that are prefixed with ‘T’ in the default product configuration, so this makes this an unlikely problem. However, you may not create database columns with names in the following lists, depending on your database vendor. The reserved words for each DBMS platform are defined in o /conf/reserved.DB2.config o /conf/reserved.MySQL.config o /conf/reserved.Oracle.config o /conf/reserved.SQLServer.config o /conf/reserved.Sybase.config Relational Junction solves this by comparing table and column names with a list of reserved words and suffixing any names found in that list with an “X”. Setting the globalReservedWords option to “true” will create a schema that does not use reserved words in any of the supported DBMS platforms, insuring a degree of portability.

Use of Long Object and Field Names
There are limitations in table and column name lengths in each supported DBMS. Relational Junction generally observes a database name length of 30 characters, and does so by truncating what could be up to 50 characters in Salesforce.com to 30 characters. If there is a tie with an existing object name, or a field name in the same object, the last character of the name is changed to 0 through 9 until a unique name is generated. You may pre-define table names by adding an entry in the RJ_OBJECT table prior to generating the schema for that object. When the object is created in the database, it will use the table name that you specify in RJ_OBJECT.

Exceeding Query Size Limits
There are known issues resulting from exceeding architectural limits of Salesforce.com’s API, typified by the following error message:
Query is either selecting too may fields or the filter conditions are too complicated.

This is not a database error in the local database, nor is it related to anything in Relational Junction. The Salesforce API limit is 10,000 characters in the SOQL query, which includes the API names of all the fields visible, a comma delimiter for each field, and a WHERE clause. The actual text of the query is in the debug log, which allows you to see how much you’ll have to shorten the query to get under the 10,000 character limit. Formula fields also generate other errors if the total length of the formula text is larger than can be accommodated by the API. Salesforce.com formula fields can cause the SOQL queries created by complex or nested formula fields (formulae fields referencing other formulae fields) to exceed architectural limits of the API. Custom formulas are limited to the following constraints:

Relational Junction for Salesforce User Manual Page 55 of 64

  

1,000 character limit per custom formula field. 4,000 character limit in the SQL query generated per formula field. 32,000 character limit on the SQL statement for entire object, including all standard and custom fields and all formula fields.

Oracle may have a 10k limit on formula length, but Salesforce actually has only a 4000 character limit at this time. There is a known feature request at this time to allow for longer formula lengths in the future, but we do not have any estimated time as to when that might be released. If you receive the error "formula is too large to execute" please reduce the size of your formula statement and validate it again. The first question you should ask is, do you actually need all those fields in your Salesforce.com objects? Sometimes database design is adversely influenced by UI design – i.e., using a series of check boxes instead a multi-valued pop list, or having several fields when one will do for various status values, or leaving unused fields in the schema that have never been implemented or have since been removed from layouts. You might look for opportunities to consolidate your schema design, or denormalize some fields into separate tables. If that won’t do, the other strategy would be to hide fields from Relational Junction. Clone the System Administrator profile (call it “Relational Junction”), reassign the account that you use for Relational Junction to this new profile, then remove the fields you don’t absolutely need in the database from view of that profile until you’re under the limit. We advise using a separate account (rj@yourdomain.com would be typical) so that you can track the source of Salesforce.com updates and you personally don’t get blamed, as well as for the ability to customize security settings such as this. Another strategy is to shorten the internal field names. This does not affect screen labels. It will break any other existing integrations, however, so be prepared to make revisions if you have other integrations already. In summary, try any combination of the following:  Remove unnecessary or obsolete fields  Review use of UI elements that can be done with fewer fields  Denormalize your database design with new related tables for any repeating groups  Shorten internal field names  Don’t overuse complex formula fields  Hide fields from the profile used by Relational Junction

Relational Junction for Salesforce User Manual Page 56 of 64

Converting Legacy Data
Legacy data conversion is a special case of integration in which the Salesforce site is often completely empty. Any data which does exist does not have foreign key references to other systems; therefore, conversion of legacy data may create duplicate data if checks are not done to verify uniqueness of customer Account and Contact names, for instance. The following scenario assumes that the Salesforce site is empty, and shows how to populate Accounts and Contacts. These are typically the most important business data to convert, and require resolution of foreign keys between accounts and their parent accounts, and between contacts and accounts.

Create your schema
Create the tables in your schema that you will be integrating with RJ4Salesforce. From the DOS or UNIX command line: RJ4Salesforce –getSchemaGlobal or… RJ4Salesforce –getSchema account –getSchema contact The getSchemaGlobal option will print a list of all tables in your conf/download.config file, plus an informational message for any other tables that it finds that are not specified. You should add these other tables to the conf/download.config file, unless you only want to replicate a subset of all the tables. There are a number of tables that typically are not turned on in the default configuration:  CurrencyType  UserTeamMember  AccountTeamMember  OpportunityTeamMember  OpportunityLineItemSchedule If you get an error indicating an invalid SOAP object, comment out that table with a “#” in the first character. Rerun the “RJ4Salesforce –getSchemaGlobal” command after making any modification to conf/download.config.

Relational Junction for Salesforce User Manual Page 57 of 64

Populate your schema from Salesforce.com
Populate the tables in your schema that you will be integrating with RJ4Salesforce. From the DOS or UNIX command line: RJ4Salesforce –getAllGlobal or… RJ4Salesforce –getAll account –getAll contact

Create Legacy Primary Keys
Add LEGACY_ID to each table you are converting or integrating with any SQL admin tool. The size of the field should be at least as large as the source system’s primary key.
ALTER TABLE TACCOUNT ADD LEGACY_ID VARCHAR(20) ALTER TABLE TACCOUNT ADD LEGACY_PARENTID VARCHAR(20)

LEGACY_ID should typically NOT be exposed to Salesforce.com because cloning records will cause a unique index violation when the LEGACY_ID values are cloned. If there is a business requirement to expose this value, you would need two fields, one of them indexed and one of them exposed in the Salesforce user interface, and trigger logic to set the user interface version of this field to the same value as the indexed field, or NULL if that is a generated value.

Create Database Triggers to Maintain Default Values
Create a trigger on each table that you will be converting or integrating to populate default values into certain fields, especially unique indexes. Oracle allows null values in unique columns, but other databases typically only allow one record in the entire table to have a null value in any unique column. Therefore, we must generate a unique value using a seed value from ETL_ID for these fields, although we should convert the data in those fields as soon as possible into “real” values. A Microsoft SQLServer trigger would look like this:
DROP TRIGGER TR_ACCOUNT_AFTER GO CREATE TRIGGER TR_ACCOUNT_AFTER ON TACCOUNT AFTER INSERT AS DECLARE @ETL_ID @ID_Generated @ID @LEGACY_ID

decimal(18,0), VARCHAR(18), VARCHAR(18), VARCHAR(20)

BEGIN SELECT @ETL_ID = i.etl_id, @ID_Generated = 'I-' + cast (i.ETL_ID as varchar), @ID = i.ID, @LEGACY_ID = i.LEGACY_ID

Relational Junction for Salesforce User Manual Page 58 of 64

FROM

inserted i;

if @ID is null begin update TACCOUNT set id = @ID_Generated, delete_flag = 'I' where etl_id = @etl_id; end if @LEGACY_ID is null begin update TACCOUNT set LEGACY_ID = @ID_Generated where etl_id = @etl_id; end END RETURN GO

The Oracle equivalent would modify the triggers created by Relational Junction to seed the TACCOUNT ID column:
CREATE OR REPLACE TRIGGER XACCOUNT before insert on TACCOUNT for each row declare begin select SACCOUNT.nextval into :new.ETL_ID from dual; if :new.id is null then :new.id := 'X-' + cast(:new.etl_id as varchar); end if; end;/

Default LEGACY_ID
Default all LEGACY_ID values so that we may create a unique index on them.
UPDATE TACCOUNT SET LEGACY_ID = LEGACY_ID

This operation will invoke the trigger we have just created to populate the generated ID into the LEGACY_ID column.

Create Unique Indexes for Integration
Create a unique index on LEGACY_ID so that conversion or integration ETL jobs can tie Salesforce records back to the original source system keys.
CREATE UNIQUE INDEX ACCOUNT_LEGACY_ID ON TACCOUNT(LEGACY_ID)

Create an ETL Step for the Top-Level Table
Create an ETL job to populate the top table in your hierarchy. We can start with Account, since it is the parent of Customer and Opportunity.

Relational Junction for Salesforce User Manual Page 59 of 64

Default the DELETE_FLAG to ‘I’ in your insert SQL (“Insert”), and ‘N’ in your update SQL (“Not deleted”). If you have a delete indicator in your source data, DELETE_FLAG should be ‘D’, which causes the upload process to delete the records in Salesforce and mark them with a ‘Y’ in the database. You cannot delete records which do not yet exist in Salesforce; either ignore them entirely or first insert them to create the ID for the benefit of child records and then delete them after all the child records were created. This would give a history of the entire hierarchy, although the actual time of deletion would be when it was deleted in Salesforce, not the original date in the legacy system. Ensure that required fields are populated or defaulted. All fields which are check boxes in Salesforce must be ‘true’, ’false’, or NULL. The following columns are defaulted by Salesforce and normally cannot be overridden.  CREATEDDATE  CREATEDBYID  LASTMODIFIEDDATE  LASTMODIFIEDBYID  SYSTEMMODSTAMP If this is an initial load, you may contact Salesforce.com and have them change your organization’s settings to the CREATEDDATE can be set by you. This is a temporary setting which should be turned off after the initial load. However, you will be using SYSTEMMODSTAMP to trigger update logic in changed records. This should be a date-time that is that is greater than the last download time for this table. When you issue a -get command, these fields will be populated with the time the records were created or updated, and with the ID of the user used in the update job. All timestamps are in GMT (UTC). The simplest approach to this is to set SYSTEMMODSTAMP to one day in the future. Do not populate the PARENTID column at this time. This must only contain valid ID foreign key values of other accounts, which do not exist until the Accounts are created in Salesforce. Map your legacy parent ID’s into LEGACY_PARENTID, which is a field that is not exposed to Salesforce. Run the ETL load for the Account table and visually validate the data. It is much easier to fix your data conversion issues at this stage, so get it right before you upload it to Salesforce.

Upload your Top-Level Table
Upload the Account table to Salesforce. From the DOS or UNIX command line: RJ4salesforce –set Account –get Account The -set option will populate the ID field in your table, but not other fields. For those fields, the -get option will pull all defaulted values from Salesforce into your database after completing the upload. You should always end up with a fully synchronized database.

Relational Junction for Salesforce User Manual Page 60 of 64

Resolve Foreign Key Relationships
Populate the PARENTID column of the Account with a SQL script:
UPDATE TACCOUNT C SET PARENTID = (SELECT ID FROM TACCOUNT P WHERE P.LEGACY_ID = C.LEGACY_PARENTID), SYSTEMMODSTAMP = GETDATE() + 1 WHERE LEGACY_PARENTID IS NOT NULL AND PARENTID IS NULL

Upload the Account table to Salesforce. From a command line: RJ4Salesforce –set Account –get Account

Prepare Update Trigger for the Second-Level Table
Create a database update trigger for the next second-level table in your hierarchy similar to the first one we did. This is typically Contact, since it is the child of Account. We need to resolve the parent’s foreign key. Assuming that you will populate the legacy ID of the parent into ACCOUNTID of the Contact table, put an extra step in this trigger to resolve the parent foreign key.
if @ACCOUNTID not like '0013%' begin SELECT @ACCOUNTID = A.ID FROM TACCOUNT A WHERE LEGACY_ID = @ACCOUNTID UPDATE TCONTACT SET ACCOUNTID = @ACCOUNTID WHERE ETL_ID = @ETL_ID; end

‘0013’ is the key pattern for an Account record in Salesforce. The Oracle triggers and indexes to implement this would look like this:
create index contact_accountid on tcontact(accountid); create index opportunity_accountid on topportunity(accountid);

CREATE OR REPLACE TRIGGER AACCOUNT after update on TACCOUNT for each row declare begin if :new.ID <> :old.ID then update tcontact set accountid = :new.id, systemmodstamp = sysdate + 1 where accountid = :old.id; update topportunity set accountid = :new.id, systemmodstamp = sysdate + 1 where accountid = :old.id;

Relational Junction for Salesforce User Manual Page 61 of 64

end if; end;

The –getTrigger command will generate this trigger automatically to update the foreign key fields of all child objects. The –getIndex command will generate the supporting indexes on the child objects.

Create an ETL Step for the Second-Level Table
Create an ETL job to populate the next second-level table in your hierarchy. Run the ETL load for the Account table and visually validate the data. It is much easier to fix your data conversion issues at this stage, so get it right before you upload it to Salesforce.

Upload your Second-Level Table
Next, upload the Contact table to Salesforce. From the DOS or UNIX command line: RJ4salesforce –set Contact –get Contact

Parallel Loading Large Tables to Salesforce
You may elect to load very large amounts of data in parallel within a given object. Account and Opportunity are the slowest objects to load via -set, varying between two and five records per second due to extensive processing on the Salesforce.com side. We have benchmarked Relational Junction against AppExchange Data Loader with similar results. Parallel loads do not seem to negatively affect overall performance or compete with each other on the Salesforce.com side. There is an absolute limit of 5 API sessions per Salesforce.com user account, and 50 concurrent API sessions within a Salesforce org. This is effectively 4 sessions per user account and roughly 46 sessions per org due to Relational Junction pro-actively reconnecting before sessions time out, as determined by the connectionTimeOut property. Since there is no logout API call, the oldest session of 5 would be forced out to allow the new session to log in, most likely disconnecting one of the other sessions. You will need to devise a key range selection method that splits your data within a given table into approximately equal ranges for the number of parallel processes that you wish to load at one time. Create separate property files (rj4salesforce.properties.objectName1, rj4salesforce.properties.objectName2, etc.) for each key range of each object you wish to parallel load, and code an “objectName.where” property that gives a valid SQL WHERE clause that will segment the load. Available memory and processor power becomes the gating factor at this point, with each process consuming 1 GB of RAM and 40% of a single CPU processor (or 20% of a dual-core processor) if bufferSize is 200. You may elect to federate a data load by setting up several Relational Junction servers using the above guidelines to achieve maximum throughput.

Relational Junction for Salesforce User Manual Page 62 of 64

Tracking Merged Records
If Accounts, Contacts, or Leads contain references to keys in external applications, they will be become orphaned if users merge the records in Salesforce. You may solve this by creating custom objects in Salesforce that are dependents of Account, Contact, or Lead, and putting the integration keys in the custom objects (IntegrationAccount, IntegrationContact, IntegrationLead). When the objects are merged, the custom objects will be re-parented to the “surviving” object, which would then have two dependents. Before:  Account1  IntegrationAccount1  Account2  IntegrationAccount2 After:  Account1  IntegrationAccount1, IntegrationAccount2

Populating a Data-Only Sandbox
Salesforce.com provides a full Sandbox as a complete copy of a production org or a data-only Sandbox with only the metadata and User accounts. The following procedure can be used to populate a data-only Sandbox from production data.
1. Build the database by one of the following:  –getGlobal  Database export / import of your production database (best) 2. Point the rj4salesforce.properties at the sandbox and the database that was just created 3. Build integration triggers and supporting indexes  –getTriggerGlobal  –getIndexGlobal 4. In SQL, prep the database for upload for uploadable tables a. Update tablename set delete_flag = ‘I’, systemmodstamp = null; (do this for all tables; if they don’t have a systemmodstamp, they are not createtable anyway) b. Set data conditions to avoid API exceptions in the following tables: update set where and update set where and update set where and TOpportunityLineItem totalprice = null delete_flag = 'I' unitprice <> 0; TOpportunityLineItem unitprice = null delete_flag = 'I' unitprice = 0; TPartner AccountFromId = null delete_flag = 'I' OpportunityId is not null;

5. Verify upload.config so that objects are loaded in hierarchical order

Relational Junction for Salesforce User Manual Page 63 of 64

–checkGlobal (gives a report with warnings; re-sort the objects in upload.config until there are no warnings) 6. Load Accounts with recursive Parent Account relationship –set Accounts –set Accounts (repeat until parent account errors go away, probably by the second pass) 7. Load the other tables -setGlobal

Relational Junction for Salesforce User Manual Page 64 of 64

Sign up to vote on this title
UsefulNot useful