customization - Acumatica 自定义所有者选择器
问题描述
是否可以在 Acumatica 的“所有者”选择器中按特定部门进行硬编码和过滤?
DAC:AR.Arinvoice
所有者 ID
[PXDBGuid()]
[PXDefault(typeof(Customer.ownerID), PersistingCheck = PXPersistingCheck.Nothing)]
[PXOwnerSelector(typeof(ARInvoice.workgroupID))]
[PXUIField(DisplayName = "Owner", Visibility = PXUIVisibility.SelectorVisible)]
解决方案
是的,您可以使用 PXRestrictor 属性将过滤器添加到选择器。
使用 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")]
推荐阅读
- c++ - 围绕某个点旋转对象,即使原始枢轴不同?
- laravel - 为什么 Laravel 在我的 body 标签中显示自定义单词?
- c# - 使用 Crypto++ 进行 RSA 编码并使用 c# RSACryptoServiceProvider 进行解码
- angular - *NgIf 用于显示下拉菜单
- android - 如何将 python web 应用程序转换为 android .apk
- shell - 是否可以使用替代配置文件运行 ksh/bash?
- count - 如何在SPSS中迭代和增加一个计数器?
- flutter - Flutter BLoC(flutter_bloc plugin) 输入焦点的奇怪行为。额外的状态调用
- winapi - 通过 ReadFile 从串口读取非常慢
- typescript - 有没有办法从 NestJS 应用程序中收集所有方法及其路径?