Need to show all production id's when filter is removed

Hi all

I'm trying to filter the records based on Production id, when I give production id stringedit text box form is getting filtered based on the record I'm entering at the same time when i remove the production id it need to show entire production id

public boolean modified()
{
    boolean ret;

    ret = super();
    breakpoint;
    if (this.valueStr()!="")
    {
    ProdTable_ds.query().dataSourceTable(tablenum(ProdTable)).clearDynalinks();
    ProdTable_ds.query().dataSourceTable(tablenum(ProdTable)).clearRange(fieldnum(ProdTable, ProdId));
    ProdTable_ds.query().dataSourceTable(tablenum(ProdTable)).addRange(fieldnum(ProdTable, ProdId)).value(queryValue(this.text()));
    ProdTable_ds.executeQuery();
    
    }
    else
    {
    ProdTable_ds.query().dataSourceTable(tablenum(ProdTable)).addRange(fieldnum(ProdTable,ProdId)).value(queryValue(SysQuery::valueUnlimited()));
    ProdTable_ds.executeQuery();
    }

    return ret;
}

May I know how to do this?

  • public void executeQuery()
    {
        QueryBuildRange prodidfilter,itemidfilter,statusfilter,sitefilter;;
    
        prodidfilter = SysQuery::findOrCreateRange(ProdTable_q.datasourceTable(tableNum(ProdTable)),fieldNum(ProdTable,ProdId));
        itemidfilter= SysQuery::findOrCreateRange(ProdTable_q.datasourceTable(tableNum(ProdTable)),fieldNum(ProdTable,ItemId));
        statusfilter= SysQuery::findOrCreateRange(ProdTable_q.datasourceTable(tableNum(ProdTable)),fieldNum(ProdTable,ProdStatus));
        sitefilter = SysQuery::findOrCreateRange(ProdTable_q.datasourceTable(tableNum(InventDim)),fieldNum(InventDim, InventSiteId));
    
        if (txtProdId.text()!="")
        {
            prodidfilter.value(queryValue(txtProdId.text()));
        }
        else
        {
            prodidfilter.value(SysQuery::valueUnlimited());
        }
        if (txtItemid.text()!="")
        {
            itemidfilter.value(queryValue(txtItemid.text()));
        }
        else
        {
            itemidfilter.value(SysQuery::valueUnlimited());
        }
        if (txtProdStatus.text()!="")
        {
            statusfilter.value(queryValue(txtProdStatus.text()));
        }
        else
        {
            statusfilter.value(SysQuery::valueUnlimited());
        }
    
         if (txtsite.text()!="")
        {
            sitefilter.value(queryValue(txtsite.text()));
        }
        else
        {
            sitefilter.value(SysQuery::valueUnlimited());
        }
    
        super();
    
    }
    

    public boolean modified()
    {
        boolean ret;
    
        ret = super();
    
        ProdTable_ds.executeQuery();
    
        return ret;
    }

    Done Like this:)

Related
Recommended