Using job queue parameters you can pass some data to your codeunits that you run via Job queue.
How it works?
Define your codeunit with TableNo = "Job Queue Entry
For example:
codeunit 50149 MyCodeunit
{
TableNo = "Job Queue Entry";
trigger OnRun()
var
SalesOrderNo: Code[20];
begin
if Rec."Parameter String" <> '' then
UpdateSalesOrderExternalDocNo(Rec."Parameter String");
end;
local procedure UpdateSalesOrderExternalDocNo(SalesOrderNo: Code[20])
var
SalesHeader: Record "Sales Header";
begin
if SalesHeader.get(SalesHeader."Document Type"::Order, SalesOrderNo) then begin
SalesHeader.Validate("External Document No.", SalesOrderNo);
SalesHeader.Modify()
end;
end;
}
This job queue gets sales order number via the parameter string and then updates the sales order external doc no when sales order is found from the number.
Now you can define the job queue and the parameter will be passed to the code unit:
And the sales order is updated with the parameter: