【问题标题】:Use Non Persistent field in Generic Inquiry Conditions在通用查询条件中使用非持久字段
【发布时间】:2021-01-07 06:20:40
【问题描述】:

我正在构建一个通用查询,它将列出带有 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


    【解决方案1】:

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

    【讨论】:

    • 谢谢。很高兴知道,不确定我是否在文档中错过了这一点。
    猜你喜欢
    • 2019-05-26
    • 1970-01-01
    • 1970-01-01
    • 2014-05-09
    • 1970-01-01
    • 1970-01-01
    • 2019-11-19
    • 2015-07-14
    • 1970-01-01
    相关资源
    最近更新 更多