Greetings!
I'm creating a new report and added to it a datasource.
The report is run from extended RunBaseReport Class and in the dialog method
I create a dialog in witch I added an enum type combobox.
What I am trying to do is hide the select button depending on what value the user has selected.
X++:
public Object dialog(Object _dialog)
{
InventFertilizerReportDesign inventFert;
;
dlg = super(_dialog);
dlgFldDesignVal = dlg.addField(typeId(InventFertilizerReportDesign), "@LVT76");
dlgFldDesignVal.value(reportDesign);
dlgFldDateFrom = dlg.addField(typeId(TransDate), "@SYS5209");
dlgFldDateFrom.value(dateFrom);
dlgFldDateTo = dlg.addField(typeId(TransDate), "@SYS80662");
dlgFldDateTo.value(datoTo);
dlgFldShopId = dlg.addField(typeId(ReShopId));
dlgFldShopId.value(shopId);
dlgFldShowPrice = dlg.addField(typeId(NoYes), "@LVT4117");
dlgFldShowWeight = dlg.addField(typeId(NoYes), "@LVT4119");
return dlg;
}
In method "dialogPostRun" I set controlMethodOverload to true
X++:
super(dialog);
dialog.dialogForm().formRun().controlMethodOverload(true);
dialog.dialogForm().formRun().controlMethodOverloadObject(this);
X++:
public int Fld6_1_selectionChange()
{
int ret;
Object mainFormGroupOrig;
Object control = dlg.formRun().controlCallingMethod();
ret = control.selectionChange();
switch (dlgFldDesignVal.value())
{
case InventFertilizerReportDesign::AmmoniaNitrateDesign :
showQueryValues = true;
dlgFldDateFrom.visible(true);
dlgFldDateTo.visible(true);
dlgFldShopId.visible(true);
dlgFldShowPrice.visible(false);
dlgFldShowWeight.visible(false);
break;
case InventFertilizerReportDesign::SalesReport :
showQueryValues = false;
dlgFldDateFrom.visible(false);
dlgFldDateTo.visible(false);
dlgFldShopId.visible(false);
dlgFldShowPrice.visible(true);
dlgFldShowWeight.visible(true);
break;
}
reportDesign = dlgFldDesignVal.value();
return ret;
}
X++:
public boolean showQueryValues()
{;
return showQueryValues;
}
as simple it may be I can't figure out how to hide or show the button.