How to sort in desc order a grid of a form
You put this code in the init methode of the datasource:
super()
this.query().dataSourceTable(tableNum(InventTable)).addSortField(fieldNum(InventTable, RecId),SortOrder::Descending);
super()
this.query().dataSourceTable(tableNum(InventTable)).addSortField(fieldNum(InventTable, RecId),SortOrder::Descending);
Assuming you are trying to sort field on datasource CustTable:
1) override modified() method on form control to call executeQuery() of the datasource
public boolean modified()
{
boolean ret;
;
ret = super();
{
boolean ret;
;
ret = super();
CustTable_ds.executeQuery();
return ret;
}
}
2) override executeQuery() method on datasource to change sortorder before actual fetch of records
public void executeQuery()
{;
{;
this.query().dataSourceTable(tableNum(CustTable)).addSortField(fieldNum(CustTable, RecId),SortOrder::Descending);
super();
}
}
Reference
Sort Descending date on Grid
TECDeliveryOrderTable_ds.query().dataSourceTable(
tablenum(TECDeliveryOrderTable)).addSortField(
fieldNum(TECDeliveryOrderTable,InvoiceDate),
SortOrder::Descending);
tablenum(TECDeliveryOrderTable)).addSortField(
fieldNum(TECDeliveryOrderTable,InvoiceDate),
SortOrder::Descending);
sorliWneusa Amber Rhodes https://wakelet.com/wake/S3P3zrHwP1secv8SxoP0D
ReplyDeletediasipusuns