【问题标题】:Acumatica - Change Field Attributes of DropdownAcumatica - 更改下拉列表的字段属性
【发布时间】:2018-04-04 14:32:20
【问题描述】:

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

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

【问题讨论】:

    标签: customization acumatica


    【解决方案1】:

    您可以通过以下方式之一进行操作:

    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){}
    

    【讨论】:

    • 公共类 ARRegisterExt : PXCacheExtension { #region UsrDivision [PXOverride] [PXDBString(3, IsFixed = true, IsUnicode = true, InputMask = "")] [PXStringList (新字符串 [] {“comp1”、“comp2”、“comp3”、“comp4”、“comp5”、“comp6”、“comp7”},新字符串 [] {“comp1”、“comp2”、“comp3 ", "comp4", "comp5", "comp6", "comp7"})] [PXUIField(DisplayName = "Company")] public string UsrDivision { get;放; } 公共类 usrDivision : IBqlField{} #endregion }
    • 我使用上面的代码没有运气,这是一个CacheExtension方式
    • @Dane 您的UsrDivision 字段是在ARRegister 的扩展 中定义的,而不是在ARRegister 中定义的尝试编写CacheAttached 事件或使用@ 更改列表987654333@
    • @Dane 我认为您不需要添加 PXOverride 属性,因为它用于覆盖操作而不是属性或方法。
    • 我尝试了 SetList,但我一直在 ARRegister DAC 中找不到 usrDivision,我知道,但 ARRegisterExt 也无效。有没有办法解决这个问题?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-03-14
    • 1970-01-01
    • 2011-11-22
    • 2014-06-28
    • 1970-01-01
    • 2016-10-25
    • 1970-01-01
    相关资源
    最近更新 更多