I have created a document report in Visual Studio Code. The report pulls data from the Sales Header table, as well as the Sales Lines subform and the Locations table, which are linked through the customer number and location code respectively.
The form is a Bill of Lading, and I have created the layout in Word.
The report runs off a link I have added to the Sales Order page (page 42):
actions
{
addlast(reporting)
{
action(WGP_BOL_Report)
{
ApplicationArea = All;
Caption = 'Bill of Lading';
trigger OnAction();
begin
Report.Run(Report::WGP_BOL_Report);
end;
}
}
}
I would like it to pull the fields from the currently selected Sales Order, and use the customer number in the currently selected Sales Order and the location code in the currently selected sales order to populate the Bill of Lading form. However, it is currently pulling the data from the first record in the Sales Order List.
TIA!