How to ensure that the mobile field must contain a unique value?
i want to make phone field unique for this i have tried triggers but i want to write validation rule for this i have written something like
AND( CONTAINS( VLOOKUP( $ObjectType.Student_Information__c.Fields.Phone_no__c, $ObjectType.Student_Information__c.Fields.Phone_no__c, Phone_no__c ), Phone_no__c ), OR( ISNEW(), ISCHANGED(Phone_no__c) ) )
vlookup is not working for phone type field can you please help me with this, Is there any idea that I can make the phone field unique ?
To ensure that the mobile field must contain a unique value -
Have you considered using duplicate management (i.e., create a matching rule and a duplicate rule) instead of a validation rule? IMHO that feels better for phone numbers since it would also allow you to change the behaviour easily from completely blocking the creation of a new record with a non-unique phone number to just warning the user about a possible duplicate and leaving the choice on how to proceed to the user. After all, phone numbers might not be fully unique (esp. if land lines are included or if you consider a long duration where a cell number might be reassigned to a different subscriber). Since you can't use VLOOKUP or the unique attribute on data fields of type phone, another option would be to change the data type to text -- but keep in mind that you lose the default functionality of a phone field with this (e.g., you'd have to create a validation rule with REGEX to enforce the format to a legal phone number).