acumatica - 你应该如何使用 PXDBCryptString 属性来解密一个值
问题描述
我在 DAC 中使用以下定义,期望结果在数据库中被加密,但在图形类中的 UI 或代码中显示为解密。我得到的结果是它在 UI 和代码中显示了加密的值。我无法弄清楚我应该如何解密返回的值。
我正在尝试查找有关如何使用此属性的更多信息,但是 2018R1-AcumaticaFramework-DevelopmentGuide.pdf 仅包含稀疏信息。它具有以下链接PXDBCryptLink https://help.acumatica.com/Main?ScreenId=ShowWiki&pageid=176377a7-4d01-786c-a56d-e17ccbf188f0但该链接似乎不再可用。我也无法在 T200 文档中找到任何内容。
有没有人知道如何正确解密使用此属性的值?
提前致谢
#region C2PAPIKEY
public abstract class c2PAPIKEY : PX.Data.IBqlField
{
}
protected string _C2PAPIKEY;
//[PXDBString(50, IsUnicode = true)]
//not having any luck getting these encryption attributes to work
//the value coming back is always encrypted regardless of the
//IsVeiwDecrypted being set to true
//[PXRSACryptString(50, IsUnicode = true, IsViewDecrypted = true)]
[PXDBCryptString(50, IsUnicode = true, IsViewDecrypted = true)]
[PXDefault("")]
[PXUIField(DisplayName = "Click to Pay API Key")]
public virtual string C2PAPIKEY
{
get
{
return this._C2PAPIKEY;
}
set
{
this._C2PAPIKEY = value;
}
}
#endregion
解决方案
我看过一些例子,我相信这个值必须在缓存中显式解密。
这可以使用 RowSelected 事件处理程序在图中完成:
// Make sure DAC is of the type that holds the C2PAPIKEY field
public virtual void DAC_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
PXDBCryptStringAttribute.SetDecrypted<DAC.c2PAPIKEY>(sender, e.Row, true);
}
推荐阅读
- python - 在表示最近一次修改但没有最近修改的文件的目录中找不到 .ipynb
- git - git reset --hard 后如何恢复我的最新提交?
- python - Dagster 使用其输出从另一个管道启动管道
- google-data-studio - 字符串在 Google Data Studio 中包含子字符串的情况
- iar - 紫蜂<----> CC2530
- javascript - 如何在 Google Chrome 中的 HTML 输入标签 type="number" 中用点而不是逗号显示十进制数字
- ns-3 - 无法在示例/无线/wifi-simple-adhoc-grid.cc 中的 ns-3 中接收 UDP 数据包
- android-studio - 在 Android 上使用 Cloud Storage 上传文件会导致未选中呼叫警告
- google-cloud-platform - 将数据集移动到另一个区域 bigquery
- python - 将值附加到空数据框中的问题