how can i get the item no when i import quantity into item journal line using dataport

how can i get the item no when i import quantity into item journal line using dataport,

First Case when some item no is missing in data port but have quantity, how can i get those item nos.

Second Case when i pass No2 field in data port because No2 field is not missing and can i get the item no by using No2 Field, No2 field is unique.

Thanks.

Hi Smnehal,

You need to add code to Your dataport.

There is a trigger called “OnAfterImport”, that is called after Navision have read the file, but before the records are put in the database.
This is where You want to add code.

Case 1.
If there is no unique identificator of the item (such as No2 in Your case 2), then You have a serious problem.

Both cases:
OnAfterImport:
Define a local record-variable of DataType = Record, SubType = Item.
Put the needed filters on the record-variable, and fetch the correct record from the database.
e.g. - Case 2
SETFILTER(No2*,imported value of No2*);
FINDFIRST();
Then assign proper values from the record-variable to the imported values.