function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sesha Raosesha Rao 

Validation rule not working on text encrypted field.Please Help

I Have a picklist field with the name" ID_Proof " with the picklist values as "Pan Card","Aadhar Card" and a Text Encrypted field of " PanCard " I want a write a validation such that whenever I select the ID_Proof as "PanCard " the pan card shouldnt be empty.
No errors have been thrown for the validation but when I am saving the new card selecting the ID_Proof as Pan Card and without giving the Pan card details the record is getting saved without any error. Please help.
User-added image
Best Answer chosen by sesha Rao
SandhyaSandhya (Salesforce Developers) 
AND(
ISPICKVAL(Id_Poof_c,"pancard"),
(LEN(PanCard__C) ==0)
)

Please try this.

Let me know if you need more help

Thanks and Regards
sandhya

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi sesha Roa,


Since PanCard
AND(ISPICKVAL(Id_Poof_c,"pancard"),LEN(PanCard__C =0))

is an encrypted field ISBLANK and ISNULL wont work on the field.
use LEN instead of ISBLANK for pancard.

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.

Thanks and Regards
sandhya
sesha Raosesha Rao
Thanks for the response sandhya. I have tried as per your suggestion but still the error persists.Please find the error image below.Please advice.

User-added image
SandhyaSandhya (Salesforce Developers) 
AND(
ISPICKVAL(Id_Poof_c,"pancard"),
(LEN(PanCard__C) ==0)
)

Please try this.

Let me know if you need more help

Thanks and Regards
sandhya
This was selected as the best answer
sesha Raosesha Rao
Kudos!!!! 
GangadharGangadhar
Thanks Sandhya!!!
It's working fine
GangadharGangadhar
Sesha Rao
you didnot enter pan_card__c==0