WITH ItemApplnEntry DO BEGIN RESET; SETCURRENTKEY( "Inbound Item Entry No.","Item Ledger Entry No.","Outbound Item Entry No.","Cost Application"); SETRANGE("Inbound Item Entry No.",InbndItemLedgEntryNo); SETRANGE("Item Ledger Entry No.",InbndItemLedgEntryNo); SETFILTER("Outbound Item Entry No.",'<>%1',0); SETRANGE("Cost Application",TRUE); EXIT(FIND('-')); END;