How can i make dataports work for me?

magnifiquemagnifique Member Posts: 43
edited 2005-10-13 in Navision Financials
i have been trying to import some data with dataports but it is not workin and i tried to export as well it didn't work. i am wondering if they actually work.has anyone really used dataports to import a comma-separated text data file into a table before? if yes how did you do it.i really need your help to save my head ](*,) :-k

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    They work. Trust me.

    Have you defined any dataport fields?
  • magnifiquemagnifique Member Posts: 43
    yes i did define some dataport fields
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Ok, than it is a bit strange because if you just create a new dataport, put some fields in it it should work emidiately.

    Try to have a look at the properties to see if there is something strange in this.

    What table are you trying to populate/export?
  • magnifiquemagnifique Member Posts: 43
    these are the fields in the table are: No. ,glt_accno,glt_ptype,glt_oaccno,
    glt_pno,glt_bno,glt_desc,glt_tcode,glt_pm,glt_amt,glt_loc,glt_trackid,
    glt_date,glt_time,glt_uname

    these fields in the table reflects the number of comma-separted fields in a record in the data file.the file has one 173,000 records.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Are these the field names in the table? How do you do this? Do you have readable captions? :?

    Are you sure glt_xxx are no global variables?

    Is the key of the table also included in the import file? Or have you written some code for making the key?

    Do you have any code in the dataport?
  • magnifiquemagnifique Member Posts: 43
    yeah these field names are in the table.am trying to import the data in the csv file into the table.readable captions where?
    am dead sure glt_xxx are no global variables.the key being No. is not included in the import file and i haven't written any code to make the key and furthermore,there is no code in the dataport.if i have to write some code in the dataport or to make the key, help me out because am desperate.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Ok.

    The records in the database need to be unique, so you have to define some sort of key.

    What are the key fields of the table?
  • Captain_DX4Captain_DX4 Member Posts: 230
    I have had instances where it seem the AutoSave attribute didn't work as I'd expected it to. Try two things:

    1) Update the AutoReplace attribute to say "Yes"
    2) In the dataitem.OnAfterImportRecord trigger, put in an INSERT; command.
    Kristopher Webb
    Microsoft Dynamics NAV Developer
  • DenSterDenSter Member Posts: 8,307
    Better yet:
    IF NOT INSERT THEN MODIFY;
    
Sign In or Register to comment.