Problem statement - To check if the record has Opted In or not

 

 

Solution - 

  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_In__c , smagicinteract__Contact__r.MobilePhone = smagicinteract__PhoneNumber__c )

 

 

 

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

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