How to run CodeUnit

AnitaOAnitaO Member Posts: 10
I wonder if you make an CodeUnit, can you call for a report in a CodeUnit, for an exemple Run.REPORT(50000), but can you also give a filter example RUN.REPORT(50000,Vendor."No.")?

Answers

  • TallyHoTallyHo Member Posts: 417
    Hi, this is how this is done:

    In you codeunit put:

    SalesHeader.SETCURRENTKEY("Document Type");
    SalesHeader.SETRANGE("Document Type",SalesHeader."Document Type"::Order);
    SomeReport.SETTABLEVIEW(SalesHeader); // Only view sales orders.
    SomeReport.RUN;




Sign In or Register to comment.