Problem statement - If you have multiple phone fields on a single record and want to setup separate opt out fields for the same. And messages should not go out if the respective opt out field is marked as true.


  1. Go to Setup
  2. In the quick find/search box, type "object"
  3. Now select object
  4. Click on SMS History
  5. Now go to the "Validation Rules" section
  6. Click on New
  7. Write a Rule name
  8. Ensure that the "Active" checkbox is marked as True.
  9. Now add the following formula and replace the colored part (mentioned below)
  10. In the "Error Message" type true  (you can add any value here, it will show a generic error while sending out SMS to opted out record)

AND( smagicinteract__Contact__r.SMS_Opt_Out_2_new__c , smagicinteract__Contact__r.MobilePhone = smagicinteract__PhoneNumber__c )

smagicinteract__Contact__r.SMS_Opt_Out_2_new__c = the opt out field .  - (you need to replace this with the API name of your opt out field)

smagicinteract__Contact__r.MobilePhone = the related phone field .  - (you need to replace this with the API name of your phone field)

Repeat the above steps as many times depending on the total number of phone and opt out fields you require.