Bring item table to codeunit Sales-Post+Print

DarkHorseDarkHorse Member Posts: 389
Dear folks, on codeunit Sales-Post+Print I've a code that prints a report automatically when from sales quote you select Print+Register. The code is like this:
SalesShptHeader.RESET ;
SalesShptHeader.SETFILTER("No.",SalesShptHeader."No.") ;
RptNumserie.SETTABLEVIEW(SalesShptHeader) ;
RptNumserie.USEREQUESTFORM := FALSE;
RptNumserie.RUNMODAL ;
CLEAR(RptNumserie) ;

SalesShptHeader = is Sales Shipment Header table
RptNumserie = is the report I want to print

The code runs well but it prints the report always. Now I want that it only prints if one of the items from item table has informed a field. For example is field cap='ser'. But I can't bring me the item table to the codeunit to compare it. How can i do that?.
Thanks.

Comments

  • kinekine Member Posts: 12,562
    There are more ways how to do that. One of them s add function into the Shipment header which will go through the lines and check the field for all items and will return the result. Than you can use this function in the codeunit to make some condition...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.