I want to run a code only report is printing (When click print button in request page)
I used below code
if not (CurrReport.Preview) then begin
if TransferShipmentHeader."Printed by Warehouse" = false then begin
TransferShipmentHeader."Printed by Warehouse" := true;
TransferShipmentHeader."Printed DateTime" := CurrentDateTime;
TransferShipmentHeader."Printed By" := UserId;
TransferShipmentHeader.Modify();
end;
end;
but above mentioned code also working when we click Send to button, but it should not happen what should I do please advice