【问题标题】:Acumatica Customize Owner SelectorAcumatica 自定义所有者选择器
【发布时间】:2023-03-12 19:55:02
【问题描述】:

是否可以在 Acumatica 的“所有者”选择器中按特定部门进行硬编码和过滤?

DAC:AR.Arinvoice

所有者 ID

[PXDBGuid()]

[PXDefault(typeof(Customer.ownerID), PersistingCheck = PXPersistingCheck.Nothing)]

[PXOwnerSelector(typeof(ARInvoice.workgroupID))]

[PXUIField(DisplayName = "Owner", Visibility = PXUIVisibility.SelectorVisible)]

【问题讨论】:

    标签: customization acumatica custom-selectors


    【解决方案1】:

    是的,您可以使用 PXRestrictor 属性向 Selector 添加过滤器。

    使用 CODE 文件声明您要过滤的所有者部门常量:

    namespace PX.TM
    {
      public class AdminDepartment : PX.Data.Constant<string>
      {
         public AdminDepartment() : base("ADMIN") { }
      }
    }
    

    扩展 OwnerID DAC 字段以使用新的 PXRestrictor 过滤器附加(合并)现有属性。您可以使用代码中的 CacheAttached 方法或自定义项目编辑器的 DATA ACCESS 部分将属性附加到 DAC 字段:

    [PXRestrictor(typeof(Where<PX.TM.PXOwnerSelectorAttribute.EPEmployee.departmentID, Equal<PX.TM.AdminDepartment>>), 
                  "Owner Department Filter")]
    

    您的选择器现在按部门常量过滤:

    【讨论】:

    • 我在 CRCase DAC 上做了示例,您可以将 CRCase 替换为 ARInvoice DAC。
    • 这个概念非常有用,虽然适用于不同的应用程序。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-03
    • 2017-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-13
    相关资源
    最近更新 更多