diff --git a/lib/sf/contact.rb b/lib/sf/contact.rb index 8423ce6..2586389 100644 --- a/lib/sf/contact.rb +++ b/lib/sf/contact.rb @@ -6,7 +6,7 @@ class Sf::Contact 'Title', 'Email', 'HasOptedOutOfEmail', 'Phone', 'MailingStreet', 'MailingCity', 'MailingState', 'MailingPostalCode', 'MailingCountry', 'Status__c', 'Functional_Title__c', 'Informal_Name__c', - 'Meeting_Reg_Pre_Population_Opt_Out__c', 'Meeting_Reg_Hold__c', + 'Meeting_Reg_Pre_Population_Opt_Out__c', 'Meeting_Reg_Hold__c', 'gs_executive__c', 'techex_executive__c', 'gender__c', 'Contact_ID__c'] FIELDS_SELECT_STR = FIELDS.join(', ') @@ -63,11 +63,21 @@ def attrs_from_person end def create_from_person! - Sf.client.create("Contact", self.attrs_from_person) + begin + Sf.client.create!("Contact", self.attrs_from_person) + rescue Exception => e + self.person.errors[:base] << e.to_s + nil + end end def update_from_person! - update(self.attrs_from_person) if self.Id.present? + begin + update!(self.attrs_from_person) if self.Id.present? + rescue Exception => e + self.person.errors[:base] << e.to_s + nil + end end def sf_person_mapping diff --git a/lib/sf/version.rb b/lib/sf/version.rb index 5fcf0b2..d5d0f93 100644 --- a/lib/sf/version.rb +++ b/lib/sf/version.rb @@ -1,3 +1,3 @@ module Sf - VERSION = "0.1.28" + VERSION = "0.1.29" end