I want to pass the current record of a report into a codeunit, but I whenever I try passing 'Rec' to a procedure in the codeunit I get this error: The name 'Rec' does not exist in the current context
My code right now (Report extension for Vendor Trial Balance report):
Hi jdrco ,
try this one.
modify(vendor)
{
trigger OnAfterAfterGetRecord()
var
AutomatedReportEmail: Codeunit AutomatedReportEmail;
begin
if recvendor.get(Vendor."No.") then
AutomatedReportEmail.ReportSendmail(RecVendor);
end;
}
}
var
RecVendor: Record vendor;
Hi, Rec cannot be used in ReportExtension. This is different from Page and Table. If you want to use Vendor table, you need to declare a variable.
Hope this helps.
Thanks.
ZHU
Sohail Ahmed
858
YUN ZHU
773
Super User 2025 Season 1
Mansi Soni
569