SF_RefreshAll


SF_RefreshAll


Usage

SF_RefreshAll retrieves a list of the current objects from Salesforce and compares the current, local replicated table with the contents of the same object at Salesforce.com. It detects changes and updates the local table. Use SF_RefreshAll when you need to synchronize all your local tables with Salesforce.com.

SF_RefreshAll does not refresh all the tables created by SF_ReplicateAll. Some of the objects in Salesforce cannot be refreshed because Salesforce does not track the modification time of all objects. In addition, SF_RefreshAll skips Chatter Feed objects because of the excessive API calls required to download those objects. You can modify the stored procedures to include them if needed.

Syntax

  EXEC SF_RefreshAll '𝘭𝘪𝘯𝘬𝘦𝘥_𝘴𝘦𝘳𝘷𝘦𝘳','SchemaError','verify'

where linked_server is your linked server name.

If you have added or deleted columns from the schema on Salesforce, SF_RefreshAll prints an error message and throws an error.

If you want SF_RefreshAll to automatically call SF_Replicate instead of throwing an error, set the optional parameter SchemaError to 'Yes' in the SF_RefreshALL call. Setting this option to 'Yes' also causes DBAmp to replicate any non-refreshable tables.

You can set the optional parameter verify to 'no' , 'warn', or 'fail'. The default value is 'no'. If you set the verify parameter to 'warn' or 'fail', SF_Refresh compares the row count of the local table with the row count of the table on Salesforce and reports any difference. If the parameter is set to 'fail', SF_Refresh fails.

Example

The following example refreshes all the local Salesforce.com using the Salesforce linked server.

  EXEC SF_RefreshAll 'Salesforce'

Using the DBAmpTableOptions table

Use the DBAmpTableOptions table to skip tables in SF_RefreshAll that are not needed locally.

In addition, you can set options for tables in the DBAmpTableOptions table that are applied when you use SF_MirrorAll, SF_ReplicateAll, and SF_RefreshAll. See Using the DBAmpTableOptions table for more information.

Notes

  • The tables must contain a SystemModstamp column to be refreshed. A local copy of the table must exist and be less than 30 days old. If the tables do not exist, use SF_ReplicateAll to make a local set of tables before refreshing.

    Tables that do not contain a SystemModstamp column are ignored unless the SchemaError parameter is 'Yes'. These are typically the Salesforce.com tables that end with “Status” (like CaseStatus).

  • SF_RefreshAll calls SF_Refresh for each valid local table.

  • There are some tables, like Vote and UserProfileFeed, in Salesforce that are not included in SF_RefreshAll. The Salesforce.com API does not allow selecting all rows from these tables. SF_RefreshAll also skips Chatter Feed objects because of the excessive API calls required to download those objects. You can modify the stored procedures to include them if needed.