I have a txt file which contains item no and Description .
I want to insert these values into a table (TableA) which contaions Item No1 and Descriptions1.
For this I have created a DATAPORT for TableA.
I want to do this in this away first dataport match the item no with the Item No1. and THEN insert the Descrition into the Description1 ELSE insert nothing?
How it will be controlled?
0
Comments
If that field is not a primary key in this table, then you have to do it by code (SETCURRENTKEY - SETRANGE - FIND('-') the record, VALIDATE the field, MODIFY the record and so on). Probably in the OnAfterImport trigger.
When I have to do validation by code in a dataport (e.g. cropping field entries which are too long) I'm using the onBeforeEvaluateField trigger.
It is passed the parameter Text by reference, where you can modify the field before the data is inserted.
This is where I would implement the logic to check the import, the same way you suggested it.
But, as I said, it is just a suggestion that works for me.
cheers, m.
well, of course this was something I didn't understand in the question then - but looking at it again now, I think you re right.
thanks for clarifying it.