Skip to main content

Hi, i encrypted the “TaxRegistrationID” field for vendor with a customization project using this Acumatica Article: https://www.acumatica.com/blog/technical-tuesday-encrypting-fields-acumatica-database/

I replace the PXDBString attribute with PXRSACryptString . 

Now the field is encrypted in the database but in the UI we can see the real value. Thats what we wanted.If i make an api call to Vendor end point i do get the real value but if i export the vendor or add the field to a GI i get the encrypted value.

How can i get the real value in the GI?

Hi @NChowdhury  GI’s will fetch the data from the database and display the data.

I think, in GI we cannot decrypt the database encrypted database field values due to security reasons.   


Hi @NChowdhury ,

To display the actual value in the UI,you can use the below code in row selected event.

public virtual void DAC_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
    PXRSACryptStringAttribute.SetDecrypted<DAC.c2PAPIKEY>(sender, row, true);
}

This is will work only for UI. GI and API will get only Encrypted values.


@NChowdhury We usually encrypt the data in the DB to secure the sensitive data. So it is obvious that GI and APIs can fetch the encrypted values only. 

 


I replace the PXDBString attribute with PXRSACryptString . 

Now the field is encrypted in the database but in the UI we can see the real value. Thats what we wanted.If i make an api call to Vendor end point i do get the real value but if i export the vendor or add the field to a GI i get the encrypted value.

How can i get the real value in the GI?

 

As long as-

1) Field length is the same (i.e. not changed)

2) IsViewDecrypted = true is set as in

it should show proper values in GI. 


Reply