0

Saving Multiple Phone Numbers & Email Addresses [Contact Details]

Posted January 2nd, 2012 in Tips & Tricks by John Coppedge

The goal of this approach was to have an intuitive way to enter multiple phone numbers and email addresses per contact or lead record:

 

The logic is driven by 4 workflow rules:

  1. When ‘Do Not Call’ = TRUE, update Phone to NULL.
  2. When ‘Email Opt Out’ = TRUE, update Email to NULL.
  3. When ‘Do Not Call’ = FALSE, update Phone:
    IF(TEXT(Preferred_Phone__c) == "Home Phone"
    && Home_Phone__c != ” && Home_Phone__c != NULL, Home_Phone__c,
    IF(TEXT(Preferred_Phone__c) == "Mobile Phone"
    && MobilePhone != ” && MobilePhone != NULL, MobilePhone,
    IF(TEXT(Preferred_Phone__c) == "Work Phone"
    && Work_Phone__c != ” && Work_Phone__c != NULL, Work_Phone__c,
    IF(TEXT(Preferred_Phone__c) == "Marketing Phone"
    && Marketing_Phone__c != ” && Marketing_Phone__c != NULL, Marketing_Phone__c,
    IF(TEXT(Preferred_Phone__c) == "Other Phone"
    && Other_Phone__c != ” && Other_Phone__c != NULL, Other_Phone__c,
    IF(TEXT(Preferred_Phone__c) == "Other Phone 2"
    && Other_Phone_2__c != ” && Other_Phone_2__c != NULL, Other_Phone_2__c,
    IF( Home_Phone__c != ” && Home_Phone__c != NULL, Home_Phone__c,
    IF( MobilePhone != ” && MobilePhone != NULL, MobilePhone,
    IF( Work_Phone__c != ” && Work_Phone__c != NULL, Work_Phone__c,
    IF( Marketing_Phone__c != ” && Marketing_Phone__c != NULL, Marketing_Phone__c,
    IF( Other_Phone__c != ” && Other_Phone__c != NULL, Other_Phone__c,
    IF( Other_Phone_2__c != ” && Other_Phone_2__c != NULL, Other_Phone_2__c,
    ”)))))))
    )))))
  4. When ‘Email Opt Out’ = FALSE, update Email to:
    IF(TEXT(Preferred_Email__c) == "Personal Email" && NOT(ISBLANK(Personal_Email__c)), Personal_Email__c,
    IF(TEXT(Preferred_Email__c) == "Work Email" && NOT(ISBLANK(Work_Email__c)), Work_Email__c,
    IF(TEXT(Preferred_Email__c) == "Marketing Email" && NOT(ISBLANK(Marketing_Email__c)), Marketing_Email__c,
    IF(TEXT(Preferred_Email__c) == "Other Email" && NOT(ISBLANK(Other_Email__c)), Other_Email__c,
    IF(TEXT(Preferred_Email__c) == "Other Email 2" && NOT(ISBLANK(Other_Email_2__c)), Other_Email_2__c,

    IF(NOT(ISBLANK( Personal_Email__c )), Personal_Email__c ,
    IF(NOT(ISBLANK( Work_Email__c )), Work_Email__c,
    IF(NOT(ISBLANK( Marketing_Email__c )), Marketing_Email__c,
    IF(NOT(ISBLANK( Other_Email__c )), Other_Email__c,
    IF(NOT(ISBLANK( Other_Email_2__c )), Other_Email_2__c,
    "")))))))

    )))))

 

You could probably combine these into 2 workflow rules per object as well.  This was driven with inspiration from the Non Profit starter kit, which uses a similar contact management strategy (although allows update of standard phone/email fields).

 

How do you handle multiple phone/email addresses in your org?  Have you found a better way?  I want to hear about it!

 

Cheers,

 

John