Hello, I need support to generate a report with the selected record - with the debugger the Rec (SalesHeader) has the right values, but when it creates the report it chooses the first record from the list - so I think the problem is in the report "DataitemTableView" - how is it possible to set a Filter with "No." - maybe to get the result I want?
Hello!
Maybe I forgot to mention that I'm using the report through sending an Email - so I don't want to show any Requestpage.
so I called through the OnAction-Trigger following code:
RecRef.Open(Database::"Sales Header"); Fref := RecRef.Field(3); Fref.SetFilter(Rec."No.");
and passed it to
Hi,
You can pass the record to the report. You can call the report by id or instance.
var
SalesHeader: Record "Sales Header";
SalesOrder: Report "Sales Order";
begin
SalesHeader.SetRecFilter();
// Run report by ID -
Report.Run(Report::"Sales Order", true, false, SalesHeader);
// Run the report with the report variable
SalesOrder.SetTableView(SalesHeader);
SalesOrder.RunModal();
end;
Hi,
Best way is to use a report run function with your current rec as a variable.
Check out this:
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,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148