Options

How to identify data with discrepancy in CSV file?

Aravindh_NavisionAravindh_Navision Member Posts: 258
Hi Folks,

I need to import data from CSV file to Navision. While importing record/data with discrepancy is common. I need to identify those records/data and intimate to the concerned persons.

Please guide how I can achieve this?

Comments

  • Options
    BeliasBelias Member Posts: 2,998
    some questions:
    Can you define "discrepancy"?
    What are you importing?In what tables?
    Can you post a piece of csv file?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    Aravindh_NavisionAravindh_Navision Member Posts: 258
    Dear Belias,

    1... Discrepancy I mean some mismatch of data. Say if some decimal field contains text character sort of things. What I need is, the mismatching records has to separately maintain in some temporary tables and export those data to excel. Then that excel sheet will be sent to concerned persons through mail as attachment. They'll rectify and import manually again. I have the concept, but don't know how to perform further. ](*,)

    2... I am importing the Unit Price of Items on daily basis.

    Let me know in case of any further clarification... :D
  • Options
    BeliasBelias Member Posts: 2,998
    edited 2010-06-03
    Ok, now it's clear, you have to:
    1. Import the data into text variables (ONLY TEXT), instead of directly in your table
    2. Do
    Haserror := false;
    //-Do this for all fields...
    if not haserror then
      Haserror := EVALUATE(mytable.myfield,mytextvariable);
    //+Do this for all fields...
    If not haserror then
      mytable.insert;  //or Modify
    Else
      InsertInErrorLog();
    

    Where InsertInErrorLog() is a function to manage the population of the error log table.
    Write the code in the onbeforeimport or onafterimport trigger (i never remember what's the right one).
    obviously, the autosave,autoupdate,autoreplace properties of the dataport must be false, because you manually do the insert by code.
    this is just a hint :wink:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    Aravindh_NavisionAravindh_Navision Member Posts: 258
    Thanks a lot Belias.. :D ..... Will try it up and let you know about the result. 8)
Sign In or Register to comment.