Wednesday 10 February 2016

sales table list page should show the sales order of today only

say we have a requirement where we want to show todays sales order and we dont want to show any old sales order

then we have to add a filter in the salestable list page interaction class like


public void initializeQuery(Query _query)
{
    QueryBuildDataSource    qbds;
    ProjInvoiceTable        projInvoiceTable;
    utcDateTime             dayStartDateTime;               // added by aseem

    if (isCustomer)
    {
        EPQuery::makeMyCustomerSelfServiceQuery(_query,tableNum(SalesTable));
    }

    if (this.listPage().listPageArgs() &&
        this.listPage().listPageArgs().externalRecord() &&
        this.listPage().listPageArgs().menuItemName() ==  menuitemDisplayStr(SalesTableListPage_Proj) &&
        this.listPage().listPageArgs().externalRecord().TableId == tableNum(ProjInvoiceTable))
    {
        projInvoiceTable = this.listPage().listPageArgs().externalRecord();
        qbds = _query.dataSourceTable(tableNum(SalesTable)).addDataSource(tableNum(ProjTable));
        qbds.relations(true);
        qbds.joinMode(JoinMode::ExistsJoin);
        qbds.addRange(fieldNum(ProjTable,ProjInvoiceProjId)).value(queryValue(projInvoiceTable.ProjInvoiceProjId));
    }
    dayStartDateTime = DateTimeUtil::newDateTime(today() , 0);          //
    _query.dataSourceNo(1).addRange(fieldNum(SalesTable, CreatedDateTime)).value(strFmt("> %1", datetime2str(dayStartDateTime)));
    super(_query);
}

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

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