Announcements
Hi,
I've written a page extension to add a custom report directly on the Sales Order.
pageextension 50210 APTRRC_SalesOrder extends "Sales Order" { actions { addafter(AttachAsPDF) { action(APTRRC_ASNLabel) { Caption = 'Certificate Of Analysis'; Promoted = true; Image = Report; PromotedCategory = Category11; ApplicationArea = All; trigger OnAction() var SOLine: Record "Sales Line"; begin SOLine.Reset(); SOLine.SetRange("Document No.", "No."); Report.Run(50001, true, true, SOLine); end; } } } }
Report
report 50001 APTRRC_CertificateofAnalysis { DefaultLayout = Word; WordLayout = '.\src\Business Central\src\reportLayout\Certificate of Analysis.docx'; Caption = 'Certificate of Analysis'; UsageCategory = Lists; AccessByPermission = report APTRRC_CertificateofAnalysis = X; ApplicationArea = All; dataset { dataitem(SOHeader; "Sales Header") { RequestFilterFields = "No."; column(Order_Date; "Order Date") { IncludeCaption = true; } column(External_Document_No_; "External Document No.") { IncludeCaption = true; } column(No_; "No.") { IncludeCaption = true; } column(Sell_to_Customer_No_; "Sell-to Customer No.") { IncludeCaption = true; } dataitem(CustomerInfo; Customer) { DataItemTableView = sorting("No."); DataItemLink = "No." = field("Sell-to Customer No."); column(Name; Name) { IncludeCaption = true; } column(Ship_to_Code; "Ship-to Code") { IncludeCaption = true; } column(E_Mail; "E-Mail") { IncludeCaption = true; } } dataitem(SalesLines; "Sales Line") { DataItemTableView = sorting("Document No."); RequestFilterFields = "Document No.", "Lot No."; DataItemLink = "Document No." = field("No."); column(ItemNo_; "No.") { IncludeCaption = true; } column(Description; Description) { IncludeCaption = true; } column(Bin_Code; "Bin Code") { IncludeCaption = true; } column(Lot_No_; "Lot No.") { IncludeCaption = true; } dataitem(QAExpiryDate; "Tracking Specification") { DataItemLink = "Source ID" = field("Document No."), "Lot No." = field("Lot No."), "Item No." = field("No."); column(Expiration_Date; "Expiration Date") { } } dataitem(QA; "QA Answer") { RequestFilterFields = "Source No. 3"; column(QA_Questionnaire_Code; "QA Questionnaire Code") { IncludeCaption = true; } column(QA_Question_Category_Code; "QA Question Category Code") { IncludeCaption = true; } column(Answer; Answer) { IncludeCaption = true; } column(Source_No_; "Source No.") { IncludeCaption = true; } column(Source_No__3; "Source No. 3") { IncludeCaption = true; } dataitem(QAC; "QA Question Category") { DataItemLink = "Code" = field("QA Question Category Code"); column(CategoryDescription; Description) { IncludeCaption = true; } } dataitem(QAHeader; "QA Header") { DataItemLink = "Source No." = field("Source No."), "Source No. 3" = field("Source No. 3"); column(HeaderQuestionnaire_Code; "QA Questionnaire Code") { } dataitem(ExpiryDate; "QA Questionnaire Header") { DataItemLink = "Code" = field("QA Questionnaire Code"); column(Ending_Date; "Ending Date") { IncludeCaption = true; } } } } } } } }
Any suggestions how to do that?
Hi,
Make extension of Report for adding the Filter in the Request page.
Regards
Amit Sharma
To be able to do that you should extend the sub page "Sales Order Subfom"instead of the main page.
So extend the page where you show the sales lines. Then you will have access to the serial no. of your selected sales line.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156