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
Saikiran KolliSaikiran Kolli 

How to Decrypt the Field, Its data type is Text(Encrypted)

Hi, I'm working on integration. I want to see the information of all fields. In my org, one field data type is Text(Encrypted). As I used that field in apex classes, Now I'm unable to change the field type. Please suggest me how to Decrypt the data.
NagendraNagendra (Salesforce Developers) 
Hi Saikiran,

It looks something like this:
record.Decrypt_Order__c = record.Encrypt_Order__c;
In other words, any time the encrypted field appears in Apex Code, it will have already been decrypted for you. These fields are not meant to keep the data secure from the system, but to keep them secure from unauthorized users (and the system is always considered authorized). Therefore, you don't need to handle these fields any differently than a normal field, except that you should consider not exposing the encrypted value in a decrypted field if you can help it. Users with View Encrypted Data will automatically see the decrypted version instead.

Please let us know if the information helps.

Regards,
Nagendra.