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