BH Salesforce Sync
Drupal Building Housing records are synchronized from MOH SalesForce on a schedule. Salesforce is the authoritative source, and data should not be added or changed in Drupal.
There are 6 synchronizations with Salesforce which run in the following order, every cron run (so every 5 mins) The order is important, because Projects must be created before Attachments & Website Updates before Meetings & Chatter postings.
Building Housing - Projects
bh_project
Project__c
Building Housing - Website Update
bh_update
Website_Update__c
Building Housing - Project Update
bh_update
Update__c
BH Community Meeting Event
bh_meeting
Community_Meeting_Event__c
Building Housing - Parcels
bh_parcel
Parcel__c
Building Housing - Parcels-Project Assoc
bh_parcel_project_assoc
ParcelProject_Association__c
Each synchronization process does the following: A Drupal Application runs a Salesforce API object query to identify any records in the SF object which have been deleted or which have their last updated date after a last updated date stored by Drupal for that SF object. The identified records are then added/updated or deleted in Drupal. At the end of the process Drupal updates its last updated date for that object with the latest SF updated date found in the import. This date is then used as a high-water mark for the next import cycle.
Building Housing - Projects
This synchronization imports Project records from Salesforce Project__c
object into Drupals' bh_project
entity.
Building Housing - Website Update
This synchronization manages project stages, documents and messages to appear on the timeline. It extends and replaces the functionality for the Update__c object which is imported for legacy reasons in Building Housing - Project Update
.
There is only ever 1 Website Update (Website_Update__c
) record per Project (Project__c
) record in Salesforce.
There is a rule in Salesforce to stop multiple records which would potentially create confusion for project stages etc.
If multiple Website Update records do exist for a Project in Salesforce, then all records will be imported into Drupal, but ONLY the last (when ordered by createdDate) will be used in the Project Timeline.
Building Housing - Project Update
There should be no new Update__c records being created in SF. However, there are legacy records containing data which must be included in Drupal. Even though we do not normally expect the sync to process these objects, the code is important if the data is to be recreated accurately and completely (for example if a Salesforce purge is performed).
This handles legacy TextMessages (now use chatter) and document attachments (now use Website Update Attachments).
BH Community Meeting Event
This synchronization imports Community Meetings event records from Salesforce Community_Meeting_Event__c
object into Drupals bh_meeting
entity.
This is a simple mapping and the import does little except cleaning up any URLs and address fields.
The bh_meeting
record holds a reference to it's parent bh_update
which is linked to the bh_project
.
If a Meeting event is updated, or deleted in SF, then the associated record will be updated in Drupal, and if necessary will move on the timeline.
Building Housing - Parcels
Building Housing - Parcels-Project Assoc
Last updated