+ Start a Discussion

How to display the asterisk and @ between first and last characters using validation rule

Hi All,
How to display the first and last characeters before the @ with 5 asterisk betweeen then at email filed EX : (F*****D@***), please do the needful

SwethaSwetha (Salesforce Developers) 
HI Chinnodu,
You cannot accomplish this using the validation rule. The validation rule can be used for specifying an error condition and a corresponding error message. You can use the apex code to mask the email ID.

See https://developer.salesforce.com/forums/?id=9060G000000UVq9QAG for the related code.

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Validation rule is meant to validate the data. You may use workflow rule to transform the emal field as per your need.