protected boolean validate()
{
boolean isValid = true;
ABC_GeneralLedgerReportContract contract;
contract = this.getDataContractObject();
Query query = this.getFirstQuery();
QueryBuildDataSource queryBuildDataSource = query.dataSourceTable(tableNum(MainAccount));
QueryBuildRange queryBuildRange = queryBuildDataSource.findRange(fieldNum(MainAccount, MainAccountId));
if (!queryBuildRange)
{
isValid = warning("");
}
return isValid;
}
Assuming you have written your own controller class for the report, you should implement the 'preRunValidate' method on SrsReportRunController.
See InventJournalTransTransferController.preRunValidate() for an example of implementation.
In the method, you can open a dialog to prompt the user, and based on their response, you can modify the return container.
Edit: Try to do what Martin suggested, it's way prettier. Didn't think that you might have a contract class 😀
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,572 Super User 2024 Season 2
Martin Dráb 228,792 Most Valuable Professional
nmaenpaa 101,148