I have been trying to override the clicked() method on a form in order to print two reports in succession. When I click the button, the behavior I get is that the first report (a custom BOL report) runs and then only when I close it does the second report (a quality certificate) run. I would like for both of them to run when I click the button.
Both of the reports have custom controllers. Here is the code in the clicked() method:
void clicked()
{
MenuFunction menufunction;
MenuFunction certMenuFunction;
WMSOrderTrans wmsOrderTrans;
Args args;
;
menufunction = new MenuFunction(menuItemOutputStr(FSBillOfLading),MenuItemType::Output);
args = new Args();
args.parm(WMSShipment.shipmentId);
menufunction.run(args);
select firstOnly InventTransId from wmsOrderTrans
where wmsOrderTrans.shipmentId == WMSShipment.shipmentId;
if (wmsOrderTrans.getCertType() == OSCertType::Letterhead)
{
certMenuFunction = new MenuFunction(menuitemOutputStr(LetterheadCert),MenuItemType::Output);
certMenuFunction.run(args);
}
}
I am wondering if I need to nest one of the controller calls inside the other, since they use the same query and ranges. However, if I nest them, I may print them in the wrong order.
Any suggestions?
Brandt