Hi!
The function looks like this:
WITH ReturnRcptHeader DO BEGIN
COPY(Rec);
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Ret.Rcpt.");
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",ShowRequestForm,FALSE,ReturnRcptHeader);
UNTIL ReportSelection.NEXT = 0;
END;
and is called from e.g. from 6660 Posted Return Receipt.
I would like to call different reports depending on the field 'Ship-to Country Code' which is on the table 6660 Return Receipt Header. Like this:
WITH ReturnRcptHeader DO BEGIN
COPY(Rec);
IF ReturnRcptHeader."Ship-to Country Code" = 'NL' THEN
REPORT.RUNMODAL(50026,ShowRequestForm,FALSE,ReturnRcptHeader)
ELSE
REPORT.RUNMODAL(50029,ShowRequestForm,FALSE,ReturnRcptHeader);
END;
Unfortunately this C/AL Global (ReturnRcptHeader) is empty and my IF-statement won't work.
How come?
Greetings,
Rob Keizers
Pulse Automation Experts B.V.
0
Comments
returnrcptheader. COPY(Rec);
WITH ReturnRcptHeader DO BEGIN
IF ReturnRcptHeader."Ship-to Country Code" = 'NL' THEN
REPORT.RUNMODAL(50026,ShowRequestForm,FALSE,ReturnRcptHeader)
ELSE
REPORT.RUNMODAL(50029,ShowRequestForm,FALSE,ReturnRcptHeader);
END;
SB.