Acumatica - 更改下拉列表的字段属性

Acumatica - Change Field Attributes of Dropdown

我有一个 Usr 字段,该字段曾在项目中自定义。由于它已被编译成.dll,所以我没有原始文件来更改此Usr 字段。当我单击该字段并转到自定义属性时,找不到它,因为它是 Usr 字段而不在数据访问中。如果我在数据访问中找不到它,有没有办法可以更改此 Usr 字段下拉列表中的项目?我尝试通过 PXStringList 更改在屏幕级别覆盖,但这没有用。

如果我需要更多详细信息,请告诉我。

您可以通过以下方式之一完成:

  1. 为该字段的 DAC 创建 CacheExtension 并用 Attributes 覆盖 属性。
  2. Graph 中创建 CacheAttached 事件并覆盖 Attributes
  3. 使用 PXStringListAttribute.SetList<DAC.field>(cache, row, allowedValues, allowedLabels) 方法更改值和标签列表。

下面是如何使用 CacheAttached 事件更改字段属性的示例:

[PXDBString(3, IsFixed = true, IsUnicode = true, InputMask = "")]
[PXStringList(new string[] {"comp1", "comp2", "comp3", "comp4", "comp5", "comp6", "comp7"}, new string[] {"comp1", "comp2", "comp3", "comp4", "comp5", "comp6", "comp7"})] 
[PXUIField(DisplayName = "Company")]
protected virtual void ARInvoice_UsrDivision_CacheAttached(PXCache cache){}