Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
597 views
in Technique[技术] by (71.8m points)

acumatica - Use Non Persistent field in Generic Inquiry Conditions

I am building a Generic Inquiry which would list the Contract Details with FixedRecurringPriceVal and UsrCustomFixedRecurringPriceVal. The later is a custom persistent field. Now, in this Generic Inquiry I would like to list only those Contract Details from Customer Contract which have different FixedRecurringPriceVal and UsrCustomFixedRecurringPriceVal.

But, those I can use FixedRecurringPriceVal in Results Grid, it appears that I can't use this field in Condition where I needed to compare between these fields.

Upon looking at Data field source I find this.

        [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;
        }

So, for me it looks like Non Persistent field can't be used in Generic Inquiry Conditions. I did a bit of google but couldn't find any solution and also looked at the S130 Data Retrieval and Analysis and couldn't find specific to such case.

Is there any way we can achieve this?

Thanks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

No, you can't use Non Persistent fields in the Conditions.
The field dropdown is intentionally excluding them. Below is the FieldSelecting event handler from the GenericInquiryDesigner graph which is loading the dropdown.

    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));
    }

The only way, in this case, will be to create a separate page instead of GI.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...