Execution of the page with the filtered data is the usual requirement in NAV. Read the next recipe to understand lookup options.
Create a new codeunit from Object Designer.
Then add the following global variable:
Name
Data Type
SubType
ItemRec
Record
Item
Write the following code in the
OnRun
trigger of the codeunit:ItemRec.RESET; ItemRec.SETRANGE("Inventory Posting Group",'FINISHED'); IF PAGE.RUNMODAL(PAGE::"Item List",ItemRec) = ACTION::LookupOK THEN MESSAGE('Selected Item is %1, %2', ItemRec."No.", ItemRec.Description);
To complete development, save and close the codeunit.
On execution of the codeunit, you should see a window similar to the following screenshot:
Select a desired record and click on OK, or you can even simply double-click on the record to select it.