Dataport - Accessing the data before importing it

I added an initial column to the salesperson/purch table. I have a dataport that as two input columns, the code of the salesperson and the initials. What I want to do is check if the code is in the database already, if so write the initials to that record. If not I just want to skip it. I think I’m just missing something. Would I just not pick a table for the dataport? And have a global that is tied to is so I could do a .GET(salespersoncode) and then .MODIFY?

Am I even making sense? :slight_smile: Thanks for your help!

Dataitem:“Salesperson/Purchaser”

Create 3 Variables:
varCODE - type - code
varINITIALS - type - text
tableSALESPURCH. - record - “Salesperson/Purchaser”

View Dataport fields (use the Variables not the fields)
Enabled - SourceExpr - CallFieldValidate
Yes - varCODE - No
Yes - varINITIALS - No

OnAfterImportRecord()
IF tableSALESPURCH.GET(varCODE) THEN BEGIN
tableSALESPURCH.Initials := varINITIALS;
tableSALESPURCH.MODIFY;
END ELSE BEGIN
CurrDataport.SKIP;
END;