acumatica - 在通用查询条件中使用非持久字段
问题描述
我正在构建一个通用查询,它将列出带有 FixedRecurringPriceVal 和 UsrCustomFixedRecurringPriceVal 的合同详细信息。后者是自定义持久字段。现在,在这个通用查询中,我只想列出客户合同中具有不同 FixedRecurringPriceVal 和 UsrCustomFixedRecurringPriceVal 的合同详细信息。
但是,我可以在结果网格中使用 FixedRecurringPriceVal 的那些,看来我不能在需要比较这些字段的条件中使用这个字段。
在查看数据字段源时,我发现了这一点。
[PXDecimal(6)]
[PXFormula(typeof(GetItemPriceValue<
ContractDetail.contractID,
ContractDetail.contractItemID,
ContractDetailType.ContractDetail,
ContractDetail.fixedRecurringPriceOption,
Selector<ContractDetail.contractItemID, ContractItem.recurringItemID>,
ContractDetail.fixedRecurringPrice,
ContractDetail.basePriceVal,
ContractDetail.qty,
Switch<
Case<Where<Parent<Contract.status>, Equal<Contract.status.draft>,
Or<Parent<Contract.status>, Equal<Contract.status.pendingActivation>>>,
IsNull<Parent<Contract.activationDate>, Parent<Contract.startDate>>,
Case<Where<Parent<Contract.status>, Equal<Contract.status.active>,
Or<Parent<Contract.status>, Equal<Contract.status.inUpgrade>>>,
IsNull<Parent<ContractBillingSchedule.nextDate>, Current<AccessInfo.businessDate>>,
Case<Where<Parent<Contract.status>, Equal<Contract.status.expired>>,
IsNull<Parent<ContractBillingSchedule.nextDate>, Parent<Contract.expireDate>>,
Case<Where<Parent<Contract.status>, Equal<Contract.status.canceled>>,
IsNull<Parent<Contract.terminationDate>, Current<AccessInfo.businessDate>>>>>>,
Current<AccessInfo.businessDate>>>))]
[PXUIField(DisplayName = "Recurring Price")]
public decimal? FixedRecurringPriceVal
{
get;
set;
}
所以,对我来说,看起来非持久字段不能在通用查询条件中使用。我做了一些谷歌,但找不到任何解决方案,还查看了 S130 数据检索和分析,但找不到特定于这种情况的信息。
我们有什么办法可以做到这一点?
谢谢。
解决方案
不,您不能在条件中使用非持久性字段。
字段下拉列表有意排除它们。下面是加载下拉列表的 GenericInquiryDesigner 图中的 FieldSelecting 事件处理程序。
protected void GIWhere_DataFieldName_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
{
string[] allParameters = this.GetAllParameters(true);
PXStringListAttribute.SetList(cache, e.Row, typeof(GIWhere.dataFieldName).Name, allParameters, allParameters);
this.a<GIWhere.dataFieldName>(cache, e.Row, true, (PXCache c, string f) => !PXGenericInqGrph.IsVirtualField(c, f, null));
}
在这种情况下,唯一的方法是创建一个单独的页面而不是 GI。
推荐阅读
- android - 将 null 设置为 Thread 以防止 onDestroy Android 中的内存泄漏
- python - 我的代码从迭代器获取数据多少次?
- javascript - 如何在不明显呈现 html 字符串的情况下找到 html 元素 x、y、width 或 height
- python - 正则表达式 - 如何找到任何 char 后跟?后跟一个字符
- wordpress - 编辑特定产品的单个产品页面
- java - 无法打开应用程序模块 -> 调用 javac 时出错。需要完整的 JDK(不仅仅是 JRE)
- etl - 从转换中提取行为
- c++ - Consexpr 和 SSE 内在函数
- node.js - 有没有办法忽略 eslint-plugin-security 的测试文件?
- .net - Active Directory Powershell 脚本仅在 Excel 中打开源 csv 后才有效