Error on specific record during dataport import

dallasdev50dallasdev50 Member Posts: 3
I have created a dataport to match the record to the customer no. and if it is a valid record to import. I want the dataport to fail if there is a record that contains an invalid customer no. Since the import will have a large quantity of records, I would like to return an error to the user that specifies which record in the tab delimited file is invalid.

Can somebody help me do this? It is most appreciated.

Comments

  • manisharma31manisharma31 Member Posts: 285
    Data in dataport is inserted line by line.
    You can insert error message displaying the line no., customer no. or a unique record which you are importing.
    Regards,
    Manish
  • dallasdev50dallasdev50 Member Posts: 3
    How would I enter a variable in the Error(Txt) in order to be able to display an identifier of the line in error to the users? I want to make it easy for them to identify which record in their file requires correction.

    Thank you
  • matttraxmatttrax Member Posts: 2,309
    You need another variable to keep track of your line number. And the error message is like ERROR('Error on Line %1', LineNumberVariable)
  • SavatageSavatage Member Posts: 7,142
    create a seperate textfile of all the errors that occured during import.

    But you'll have to import your data into variables.

    then something like..
    if customer.get(variablecustno) then begin //map all the fields you need back to nav fields
    "no." := variablecustomerno;
    "name" := variablecustname;
    etc etc
    end else begin
    ExportFile.WRITE("variablecustno");
    CurrDataport.SKIP;
    end;

    Explained here : viewtopic.php?f=23&t=42493
    mine might be the 8th post down
Sign In or Register to comment.