33SalesforceARSync allows you to sync models and fields with Salesforce through a combination of
44Outbound Messaging, SOAP and restforce.
55
6+ ### Contents
7+
8+ - [ Installation] ( #installation )
9+ - [ Requirements] ( #requirements )
10+ - [ Salesforce Setup] ( #salesforce-setup )
11+ - [ 1. Setup Remote Access] ( #1-setup-remote-access )
12+ - [ 2. Setup Outbound Messaging] ( #2-setup-outbound-messaging )
13+ - [ restforce] ( #restforce )
14+ - [ Gem Installation] ( #gem-installation )
15+ - [ Application Setup] ( #application-setup )
16+ - [ Usage] ( #usage )
17+ - [ Configuration Options] ( #configuration-options )
18+ - [ Model Options] ( #model-options )
19+ - [ salesforce\_ sync\_ enabled] ( #salesforce_sync_enabled )
20+ - [ sync\_ attributes] ( #sync_attributes )
21+ - [ async\_ attributes] ( #async_attributes )
22+ - [ default\_ attributes\_ for\_ create] ( #default_attributes_for_create )
23+ - [ salesforce\_ id\_ attribute\_ name] ( #salesforce_id_attribute_name )
24+ - [ web\_ id\_ attribute\_ name] ( #web_id_attribute_name )
25+ - [ activerecord\_ web\_ id\_ attribute\_ name] ( #activerecord_web_id_attribute_name )
26+ - [ salesforce\_ sync\_ web\_ id] ( #salesforce_sync_web_id )
27+ - [ additional\_ lookup\_ fields] ( #additional_lookup_fields )
28+ - [ web\_ class\_ name] ( #web_class_name )
29+ - [ salesforce\_ object\_ name] ( #salesforce_object_name )
30+ - [ except] ( #except )
31+ - [ save\_ method] ( #save_method )
32+ - [ unscoped\_ updates] ( #unscoped_updates )
33+ - [ readonly\_ fields] ( #readonly_fields )
34+ - [ Stopping the Sync] ( #stopping-the-sync )
35+ - [ Manual Sync] ( #manual-sync )
36+ - [ Examples] ( #examples )
37+ - [ Our Basic Example Model] ( #our-basic-example-model )
38+ - [ Making the Model Syncable] ( #making-the-model-syncable )
39+ - [ Stopping the Model from Syncing with a Flag] ( #stopping-the-model-from-syncing-with-a-flag )
40+ - [ Stopping the Model from Syncing with a Method] ( #stopping-the-model-from-syncing-with-a-method )
41+ - [ Stopping a Record from Syncing] ( #stopping-a-record-from-syncing )
42+ - [ Specify Async Attributes] ( #specify-async-attributes )
43+ - [ Specify Default Attributes when an Object is Created] ( #specify-default-attributes-when-an-object-is-created )
44+ - [ Relationships] ( #relationships )
45+ - [ Defining a Custom Salesforce Object] ( #defining-a-custom-salesforce-object )
46+ - [ Deletes] ( #deletes )
47+ - [ Inbound Deletes] ( #inbound-deletes )
48+ - [ Outbound Deletes] ( #outbound-deletes )
49+ - [ Soft Deletes] ( #soft-deletes )
50+ - [ Errors] ( #errors )
51+ - [ Outbound Message Errors] ( #outbound-message-errors )
52+ - [ Finding your 18 Character Organization ID] ( #finding-your-18-character-organization-id )
53+ - [ Testing] ( #testing )
54+ - [ Contributing] ( #contributing )
55+
656## Installation
757
858### Requirements
@@ -144,35 +194,6 @@ An example of adding an aliased object to the deletion map should look like the
144194 Account: 'YourModelName'
145195
146196### Model Options
147- The model can have several options set:
148-
149- [ __ salesforce_sync_enabled__ ] ( #salesforce_sync_enabled )
150-
151- [ __ sync_attributes__ ] ( #sync_attributes )
152-
153- [ __ async_attributes__ ] ( #async_attributes )
154-
155- [ __ default_attributes_for_create__ ] ( #default_attributes_for_create )
156-
157- [ __ salesforce_id_attribute_name__ ] ( #salesforce_id_attribute_name )
158-
159- [ __ web_id_attribute_name__ ] ( #web_id_attribute_name )
160-
161- [ __ activerecord_web_id_attribute_name__ ] ( #activerecord_web_id_attribute_name )
162-
163- [ __ salesforce_sync_web_id__ ] ( #salesforce_sync_web_id )
164-
165- [ __ web_class_name__ ] ( #web_class_name )
166-
167- [ __ salesforce_object_name__ ] ( #salesforce_object_name )
168-
169- [ __ except__ ] ( #except )
170-
171- [ __ save_method__ ] ( #save_method )
172-
173- [ __ unscoped_updates__ ] ( #unscoped_updates )
174-
175- [ __ readonly_fields__ ] ( #readonly_fields )
176197
177198#### <a id =" salesforce_sync_enabled " ></a >salesforce_sync_enabled
178199Model level option to enable disable the sync, defaults to true.
@@ -285,7 +306,7 @@ unscoped_updates: true
285306````
286307
287308#### readonly_fields
288- Optionally set fields on the salesforce object that have been defined as Read Only in Salesforce.
309+ Optionally set fields on the salesforce object that have been defined as Read Only in Salesforce.
289310This helps to ensure that those fields are not synced from the model to salesforce (but still syncable the other way).
290311Accepts the salesforce field, not the model's fields.
291312
@@ -302,6 +323,16 @@ configuration variable _SALESFORCE_AR_SYNC_CONFIG["SYNC_ENABLED"]_
302323* The model level by setting the _ : salesforce_sync_enabled => false_ or _ : except => : method_name_
303324* The instance level by setting _ : salesforce_skip_sync => true_ in the instance
304325
326+ ### Manual Sync
327+
328+ You can trigger a manual sync of any configured attributes. All checks to skip syncing or to sync asynchronously will still be executed.
329+
330+ ``` ruby
331+ my_user_record.salesforce_sync(:email )
332+
333+ my_user_record.salesforce_sync(:email , :phone )
334+ ```
335+
305336## Examples
306337
307338### Our Basic Example Model
@@ -500,6 +531,11 @@ If the SOAP handler encounters an error it will be recorded in the log of the ou
500531 it to an 18 character id by running it through the tool located here:
501532 http://cloudjedi.wordpress.com/no-fuss-salesforce-id-converter/ or by installing the Force.com Utility Belt for Chrome.
502533
534+ ## Testing
535+ This gem uses [ Appraisal] ( https://github.com/thoughtbot/appraisal ) to test against many versions of Rails.
536+
537+ Run the test script to automatically set up and run the test suite: ` ./test `
538+
503539## Contributing
504540
5055411 . Fork it
0 commit comments