How to run CodeUnit

AnitaOAnitaO SwedenMember 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.")?


  • TallyHoTallyHo Member Posts: 370
    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.

Sign In or Register to comment.