With reference to your question I am sending code to print particular record from multiple it’s useful for you at the time of attaching your reports. Depends on situation code should be changed. This is inbuilt code but here I was added one line
ReportSelection.SETFILTER(Sequence,‘2’); //WIN 275
Because in Table Report Selections (77) the Usage fields having same name i.e. S.Quote with Sequence ID 1, 2, 3 that’s why I was added this line. This is my own created steps
Code to show the current record in print report automatically---- FOR SALES QUOTATION
(//WIN 275 CODE TO SELECT PERTICULAR RECORD FROM MULTIPLE RECORD AT THE TIME OF ATTACHING REPORTS)
STEP 1. Run page—{Report Selection – Sales (306)}-----Enter following details
Sequence Report ID Report Caption
2 50000 Sales Quote-Tool Assembly
3 50001 Sales Quote-Machine Assembly
(the above rows are inserted into Table {Report Selections (77)})
STEP 2. Go to Page {Sales Quotes (9300)}—Page Action— Add actions
Action Sales Quote-Tool Assembly
Action Sales Quote-Machin Assembly
STEP 3. Go to Code-Unit—{Document-Print (229)} --Add functions —C/AL/GLOBAL for print Quotations
PrintSalesQuoteToolAssembly(RecSalesHeader : Record “Sales Header”)
//WIN 275 CODE TO SELECT PERTICULAR RECORD FROM MULTIPLE RECORD
RecSalesHeader.SETRANGE(“No.”,RecSalesHeader.“No.”);
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::“S.Quote”);
ReportSelection.SETFILTER(“Report ID”,’<>0’);
ReportSelection.SETFILTER(Sequence,‘2’); //WIN 275
ReportSelection.FIND(’-’);
REPEAT
REPORT.RUNMODAL(ReportSelection.“Report ID”,TRUE,FALSE,RecSalesHeader);
UNTIL ReportSelection.NEXT = 0;
PrintSalesQuoteMachineAssembly(RecSalesHeader : Record “Sales Header”)
//WIN 275 CODE TO SELECT PERTICULAR RECORD FROM MULTIPLE RECORD
RecSalesHeader.SETRANGE(“No.”,RecSalesHeader.“No.”);
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::“S.Quote”);
ReportSelection.SETFILTER(“Report ID”,’<>0’);
ReportSelection.SETFILTER(Sequence,‘3’); //WIN 275
ReportSelection.FIND(’-’);
REPEAT
REPORT.RUNMODAL(ReportSelection.“Report ID”,TRUE,FALSE,RecSalesHeader);
UNTIL ReportSelection.NEXT = 0;
You will get select any one record from multiple recoords and get print of selected record
Regards,
Santosh Kumbhar