Design request pages for controlled report input
After you place report-wide and record-level logic in the execution flow, the request page becomes the controlled boundary between user intent and dataset processing. A good request page exposes useful choices, rejects invalid input early, and preserves settings when reuse helps the task.
Combine request filters and options
RequestFilterFields exposes filters for a data item's source table. Users get standard Business Central filtering behavior, including ranges and saved filter text. Use it for fields that directly restrict records, such as Customer No., City, Country/Region Code, or Salesperson Code.
Request-page fields represent options that aren't direct table filters. Examples include a minimum balance, an output mode, or whether to include extra detail. Define these fields in the requestpage layout and use clear captions and tooltips.
requestpage
{
SaveValues = true;
layout
{
area(Content)
{
group(Options)
{
field(MinimumBalance; MinimumBalance)
{
ApplicationArea = All;
Caption = 'Minimum balance';
ToolTip = 'Specifies the minimum customer balance to include.';
trigger OnValidate()
begin
if MinimumBalance < 0 then
Error(MinimumBalanceErr);
end;
}
}
}
}
}
Apply an option-derived filter in OnPreDataItem so it combines with table filters already entered on the request page. Don't replace the data item's current filter group or clear user filters unless the report requirement explicitly calls for that behavior.
Validate and apply report input
Use a field's OnValidate trigger for immediate feedback while a user edits an option. Repeat critical validation in OnPreReport because reports can run through code paths that don't depend on interactive field validation. Keep validation separate from record calculations so an invalid request fails before the report reads a large dataset.
Saved settings improve repeated work. SaveValues = true preserves request-page options and filters for a later run. Users can also work with saved report settings in the client when they need named combinations of filters and options. Saved values aren't a substitute for defaults or validation because an older saved setting can reach newer report logic.
Use request-page actions sparingly. An action should help prepare or inspect input rather than perform the report's main processing outside the report trigger flow. If an option changes the dataset, make that relationship visible in the field caption, tooltip, and validation behavior.
Test filters and saved settings
Test the request page as a contract with the dataset:
- Run with no filters and confirm the safe default scope.
- Apply one table filter, then combine filters across fields.
- Test boundary values and invalid request options.
- Reopen the report and verify saved values intentionally persist.
- Change a saved option and confirm the dataset reflects the new value.
- Run the report through code or scheduling if the solution supports those paths.
Inspect Microsoft Excel Document (data only) output to verify that request filters and option-derived filters affect records as intended. This check isolates request-page behavior from layout rendering.
For the object model and filter exposure, see Report object and RequestFilterFields property.