how to find out incorrect record when importing

import Item No. with dataport. I try to import a .csv file to current Navision system, but I am not sure all item no in csv file exists in current system. How can I find out which record to be imported is incorrect and show it with error message? Using OnBeforeEvaluateField or OnBeforeImportRecord ? Would you like to give me a code example? Thanks in advance

Add a record variable that links to the Item table and program something like this: IF NOT MyItem.GET(IncomingItemNumber) THEN ERROR('Could not find Item'); Try out where to put it, I’d start with OnBeforeImportRecord first, then test it with knowns and unknown item numbers in your file.