Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Encryption & Decryption on a string field on Vendor form using x++

(0) ShareShare
ReportReport
Posted on by 47
Hi All,
I need to encrypt a existing string field on vendor form which is BankAccount (lookup string field). as soon as I choose a bank account, it should be encrypted before saving into database & that hashed value should be visible on the field value not the actual value. then their will be a button on same vendor form, after clicking on it, it should show a dialog box type with the actual(decrypted) value of the encrypted field.
I tried to use this method - ediltEncryptedField from Global class in modifiedField method using COC but it is accepting only container type field in its FieldId params. I tried passing string field but getting casting error on that.
Suggests some solution for this.
 
Thanks & Regards,
Harshit
  • Anton Venter Profile Picture
    Anton Venter 19,493 Super User 2025 Season 1 on at
    Encryption & Decryption on a string field on Vendor form using x++
    I agree with Andre, use security to secure access to the bank account. Perhaps combined with custom display methods that mask the bank account in certain forms. The issue with the editEncryptedField method, besides it requiring a container data type, is that it uses encryption keys per enviroment, so when you move the database to another environment e.g. UAT, the encrypted data cannot be decrypted because the encryption key is different. And, if the data is encrypted, the system cannot use the data unless it's decrypted.
  • Deepak Agarwal Profile Picture
    Deepak Agarwal 8,564 on at
    Encryption & Decryption on a string field on Vendor form using x++
    Did you explore the Email parameter form in std system. 
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    Encryption & Decryption on a string field on Vendor form using x++
    Hi Harshit,
     
    For encryption, you would need a container field. Note that other processes also need the vendor bank account, e.g. payment files to be sent to a bank.
    What is the business reason for encrypting the bank account field? In case particular users are not allowed to see the value, you can use table and field permissions as part of the security to hide values. You can read more about the security approach here: Securing a menu item is not enough - table permissions - Dynamicspedia
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans