If the selection which should be extracted is inside a begin..end Block, then variables which are assigned before this block aren't passed to the extracted procedure as parameter. Instead they are just normal variables.
Example:
local procedure MyProcedure()
var
MyInt: Integer;
SalesLine: Record "Sales Line";
begin
MyInt := 5;
if true then begin
SalesLine.SetRange("Document Type", "Sales Document Type"::Order);
if SalesLine.FindSet(true) then begin
SalesLine.Quantity := MyInt;
SalesLine.Modify();
end;
end;
end;
results in
local procedure MyProcedure()
var
MyInt: Integer;
SalesLine: Record "Sales Line";
begin
MyInt := 5;
if true then begin
ExtractedProcedure();
end;
end;
local procedure ExtractedProcedure()
var
MyInt: Integer;
SalesLine: Record "Sales Line";
begin
SalesLine.SetRange("Document Type", "Sales Document Type"::Order);
if SalesLine.FindSet(true) then begin
SalesLine.Quantity := MyInt;
SalesLine.Modify();
end;
end;
If the selection which should be extracted is inside a
begin..end
Block, then variables which are assigned before this block aren't passed to the extracted procedure as parameter. Instead they are just normal variables. Example:results in