Thursday 18 June 2015

how to apply filter in a list page form

List page always extends to its listpage interaction class and if you go there in the respective list page interaction class you will find a method like

public void initializeQuery(Query _query)
{
    QueryBuildDataSource    qbds;
    ProjInvoiceTable        projInvoiceTable;

    if (this.listPage().listPageArgs() &&
             this.listPage().listPageArgs().externalRecord() &&
             this.listPage().listPageArgs().menuItemName() ==  menuitemDisplayStr(ProdTableListPage_Proj) &&
             this.listPage().listPageArgs().externalRecord().TableId == tableNum(ProjInvoiceTable))
    {
        projInvoiceTable = this.listPage().listPageArgs().externalRecord();
        qbds = _query.dataSourceTable(tableNum(ProdTable)).addDataSource(tableNum(ProjTable));
        qbds.relations(true);
        qbds.joinMode(JoinMode::ExistsJoin);
        qbds.addRange(fieldNum(ProjTable,ProjInvoiceProjId)).value(queryValue(ProjInvoiceTable.ProjInvoiceProjId));
    }

    super(_query);
}

here we can add our ranges and values to apply filter on the list page form.

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...