Skip to main content

Posts

Showing posts with the label filter recods d365 finops

Filter records on form X++

  //Step 1 //Declare a class variable //In the ClassDeclaration method of form declare a QueryBuildRange class FormRun extends ObjectRun { QueryBuildRange q lobdr; } //Step 2 //Initialize this range in the init method of datasource after super() call. public void init() { super(); qbdr = InventSum_ds.queryBuildDataSource().addRange(fieldNum(InventSum, PhysicalInvent)); qbdr.value(queryValue('>0')); //range value, in this case filter records that have PhysicalInvent Qty > 0 InventSum_ds.executeQuery(); //execute Query } Ex: qbdr = InventSum_ds.queryBuildDataSource().addRange(fieldNum(InventSum, PhysicalInvent)); qbdr.value(queryValue(‘>0’)); qbdr.value(queryValue(‘>0’)); Could be written more compact as SysQuery::findOrCreateRange(InventSum_ds.queryBuildDataSource(),fieldNum(InventSum, PhysicalInvent)).value(queryValue(‘>0’));