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

Decrypt the encrypted datatype value

n my SOject am having a encrypted(Encrypt_order) data type value and i create another one text(Decrypt_order) data type value ,after inserting the value in Encrypted(Encrypt_order) data ,i want to decrypt that encrypted value(Encrypt_order) and shown in that text(Decrypt_order) data type field value.......Any examples.....








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.