2
votes

I have a custom table where I'd like to make sure that the data for a specific field are encrypted. This means that if a query is run on that table, the data for that field would show up as an encrypted string, and only the UI would show its true value.

I've noticed someone else submitted the following case on October 18th, but no one has answered this: Encrypt Fields in a Custom Table

Is there any documented (or undocumented) process to do this?

2

2 Answers

3
votes

In short - You should use PXRSACryptStringAttribute. In the App_Data\CodeRepository\PX.Objects folder you can find examples of PXRSACryptStringAttribute usage.

To learn more about encryption - see "Managing Data Encryption" on help.acumatica.com.

2
votes

You should change you DAC as follows:

    #region Description
    public abstract class description : PX.Data.IBqlField
    {
    }
    protected string _Description;
    //[PXDBString(50, IsUnicode = true)] //Replace this line with then next
    [PXRSACryptString(50, IsUnicode = true, IsViewDecrypted = true)]
    [PXDefault("")]
    [PXUIField(DisplayName = "Description")]
    public virtual string Description
    {
        get
        {
            return this._Description;
        }
        set
        {
            this._Description = value;
        }
    }
    #endregion