0
votes

I run into this on occasion. I have list of parameters on this generic inquiry. All of them working except TaxInvoiceStatus:

enter image description here

TaxInvoiceStatus has a default value Pending :

    public abstract class taxInvoiceStatus : PX.Data.IBqlField
    {
    }
    protected int? _TaxInvoiceStatus;
    [PXDBInt()]
    [PXUIField(DisplayName = "TaxInvoice Status")]
    [PXDefault(ExtStatus.Pending)]
    [PXIntList(
        new int[]
        {
            ExtStatus.Pending,
            ExtStatus.Rejected,
            ExtStatus.Confirmed,
            ExtStatus.Initial,
            ExtStatus.Corrected,
            ExtStatus.Canceled,
            ExtStatus.WaitingApprove,
            ExtStatus.ApprovedByVendor

        },
        new string[]
        {
            "Pending",
            "Rejected",
            "Confirmed",
            "Initial",
            "Corrected",
            "Canceled",
            "Waiting Approve",
            "Approved By Vendor"

        })]
    public virtual int? TaxInvoiceStatus
    {
        get
        {
            return this._TaxInvoiceStatus;
        }
        set
        {
            this._TaxInvoiceStatus = value;
        }
    }

So the problem is that I cant set a default value null for TaxInvoiceStatus on the generic inquery page. I tried @Null, @null, null in the parameters Default Value , but none of them was working. Those are conditions :

enter image description here

And in VIEW INQUERY :

enter image description here

As you can see Tax Invoice Status is Pending and it always filters it by pending status.

Also I am wondering if it's possible for user to clear that field so make it empty.

1

1 Answers

0
votes

Generic Inquiry is very tricky when dealing with Default values. If you cannot remove the PXDefault for the field, one thing you could do is:

Create a Custom DAC that inherits from YOURDAC involved.

On your Custom DAC, remove the PXDefault Attribute only for your Status field.

public class CUSTOMDAC: YOURDAC
{
         .....

    public abstract class taxInvoiceStatus : PX.Data.IBqlField
    {
    }
    protected int? _TaxInvoiceStatus;
    [PXDBInt()]
    [PXUIField(DisplayName = "TaxInvoice Status")]
    //[PXDefault(ExtStatus.Pending)]
    [PXIntList(
        new int[]
        {
            ExtStatus.Pending,
            ExtStatus.Rejected,
            ExtStatus.Confirmed,
            ExtStatus.Initial,
            ExtStatus.Corrected,
            ExtStatus.Canceled,
            ExtStatus.WaitingApprove,
            ExtStatus.ApprovedByVendor

        },
        new string[]
        {
            "Pending",
            "Rejected",
            "Confirmed",
            "Initial",
            "Corrected",
            "Canceled",
            "Waiting Approve",
            "Approved By Vendor"

        })]
    public virtual int? TaxInvoiceStatus
    {
        get
        {
            return this._TaxInvoiceStatus;
        }
        set
        {
            this._TaxInvoiceStatus = value;
        }
    }
    ........

 }
  • Then use your new Custom DAC on the GI.