acumatica - PXSubordinateSelector 使用 Where
问题描述
我需要有关如何将 PXSubordinateSelector 属性与您可以在属性上设置的 Where 类型一起使用的信息。有人知道如何使用这个属性吗?
具体来说,如果可能,我需要通过 EPCompanyTree 表中的自定义字段过滤选择器。不确定此选择器属性使用哪些表。它似乎被塞进了 Acumatica 黑匣子。像这样的东西:
[PXSubordinateSelector(typeof(Where<EPCompanyTree.customField, Equal<{somevalue}>>))]
我尝试在 EPCompanyTree.sortorder 字段上将 Where 设置为任意过滤器,但是在单击查找时出现“未绑定”错误。
蒂亚!
解决方案
这个错误的原因是GetCommand
在PXSubordinateSelectorAttribute
. 下面是该方法的反汇编代码:
private static Type GetCommand(Type where)
{
Type whereType = typeof(Where<CREmployee.userID, Equal<Current<AccessInfo.userID>>, Or<EPCompanyTreeMember.workGroupID, Owned<Current<AccessInfo.userID>>>>);
if (where != null)
{
whereType = BqlCommand.Compose(new Type[]
{
typeof(Where2<, >),
typeof(Where<CREmployee.userID, Equal<Current<AccessInfo.userID>>, Or<EPCompanyTreeMember.workGroupID, Owned<Current<AccessInfo.userID>>>>),
typeof(And<>),
where
});
}
return BqlCommand.Compose(new Type[]
{
typeof(Search5<, , , >),
typeof(CREmployee.bAccountID),
typeof(LeftJoin<EPCompanyTreeMember, On<EPCompanyTreeMember.userID, Equal<CREmployee.userID>>>),
whereType,
typeof(Aggregate<GroupBy<CREmployee.acctCD>>)
});
}
正如您从代码中看到的那样,搜索正在组织中CREmployee
左连接EPCompanyTreeMember
,同时,您的代码正在尝试在EPCompanyTree
不参与搜索的字段上添加条件。
推荐阅读
- python - 无法在约束防火墙后面的 python 3.7 上安装带有轮子的 plot.ly
- pine-script - 如何在 pine script V4 上绘制虚线?
- presto - 如何在 Presto 中将两个键映射添加到值(数组)?
- visual-studio-code - 如何在状态栏上显示 git 远程源?
- javascript - 使用子道具测试渲染组件
- regex - 多行文本匹配的正则表达式
- javascript - 如何将 jQuery 转换为 JavaScript 名称属性
- java - Hibernate通过外键获取实体列表,没有属性
- java - 是否可以在 IntelliJ 中标记代码?
- c# - 如何使用 gitlab ci yaml 触发 C# 控制台应用程序?