Form filtered data source

1, the first place to declare variables in the form of a declaration.
public class FormRun extends ObjectRun
{
  QueryBuildRange criteriaPosted;
}
2, the data source (DataSource) corresponding ini method table.
public void init()
{
  super();
  criteriaPosted=this.query().dataSourceName('YouTable').addRange(fieldNum(YouTable,FieldName));
}
3, the method ExecuteQuery data source.
public void executeQuery()
{
  criteriaPosted.value(queryValue(Noyes::No));
  super (); // noted that the method to be executed after the parent class.
}
4, can write a checkbox, calling the method ExecuteQuery (); This enables dynamic control.
5, the difference between the data source method.
(1) DS.Research (), keep the existing condition, refresh the data, equivalent to the role of F5.
(2) DS.ExecuteQuery (), modified after the transition conditions must re-execute the query.
   DS.Reread (), re-read from the table.
   DS.Refresh (), refresh the data.
6, can be added by adding a query filter Filter mode.
InventTable_ds.filter(FieldNum(InventTable,ItemId),ItemIds);//添加
InventTable_ds.removeFilter (); // delete

Guess you like

Origin www.cnblogs.com/xtwkh1973/p/10992909.html
Recommended