Step 1: Create a runbasebatch class with all the needed methods
Step 2: Override the initParmDefault() method
public void initParmDefault()
{
Query query = new Query();
QueryBuildRange queryBuildRange;
QueryBuildDataSource queryBuildDataSource;
query.addDataSource(tablenum(CustInvoiceJour));
queryBuildDataSource=query.addDataSource(tableNum(CustInvoiceJour));
//Add Query
queryBuildRange=queryBuildDataSource.addRange(FieldNum(CustInvoiceJour,OrderAccount));
queryrun = new SysQueryRun(query);
super();
}
QueryRun queryrun()
{
return queryrun;
}
Step 3: In Run method you can apply your logic
public void run()
{
queryRun = this.queryRun();
queryRun.query().dataSourceNo(1).addRange(fieldnum(CustInvoiceJour,InvoiceDate)).value(queryValue(fromDate)+ ‘..’+ queryValue(toDate));
while(queryRun.next())
{
custInvoiceJour = queryRun.get(tablenum(CustInvoiceJour));
info(strfmt(“%1,%2”,custInvoiceJour.InvoiceId,custInvoiceJour.InvoiceDate));
}
}
Comments
Post a Comment