call different reports from one class

Hello, Maybe someone can help me. I want to reach the next. 2 variants of the report InventOnHand. To know which report has to be called I added a question on the form. Via the class InventReport_OnHand I tried to manager that the right report is choosen. With help of the debugger I saw that the method LastValueElementName took the right report. But still the original report is executed. Below are the modifications marked with MOD00001. public class InventReport_OnHand extends InventReport_DimParm { DialogGroup dialogSetupGroup; DialogField dialogIncludeService; NoYes includeService; // START: MOD00001 DialogField dialogOnlyLowStock; NoYes onlyLowStock; // END: MOD000001 // START: 2363 SP4 #define.CurrentVersion(3) #LOCALMACRO.CurrentList includeService, // START: MOD00001 onlyLowStock // END: MOD00001 #ENDMACRO // END: 2363 SP4 } public Object dialog() { ; dialog = super(); dialog.addGroup("@SYS2163"); dialogIncludeService = dialog.addFieldValue(Typeid(NoYes), includeService, “@SYS66068”); // START: MOD00001 dialogOnlyLowStock = dialog.addFieldValue(Typeid(NoYes), onlyLowStock, “Alleen laag voorraad nivo”); // END: MOD00001 return dialog; } // 2363 SP4 public boolean getFromDialog() {; includeService = dialogIncludeService.value(); // START: MOD00001 onlyLowStock = dialogOnlyLowStock.value(); // END: MOD00001 return super(); } public identifiername LastValueElementName() { //START: MOD00001 if (!OnlyLowStock) //END: MOD00001 return reportStr(InventOnHand); //START: MOD00001 else return reportStr(InventOnHandOnlyLowStock); //END: MOD00001 } Regards, Reinier

This is a “thin” answer, but I think I had a similar problem a while ago. The class probably gets re-initialized, because it’s a RunBaseBatch child. So using this kind of method won’t help. But try playing around with the RunOn property If you haven’t found the solution yet, I can try to find my old project to see how I fixed this.