首页 > 解决方案 > 在通用查询条件中使用非持久字段

问题描述

我正在构建一个通用查询,它将列出带有 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 数据检索和分析,但找不到特定于这种情况的信息。

我们有什么办法可以做到这一点?

谢谢。

标签: acumatica

解决方案


不,您不能在条件中使用非持久性字段。
字段下拉列表有意排除它们。下面是加载下拉列表的 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。


推荐阅读