How to populate the file table on NAV2013

thomastthomast Member Posts: 102
Hi Guys,

I'm migrating a .csv import from NAV2009 (dataport) to NAV2013 (xmlport). The import works fine, but the code that moves the file from its folder to an archive folder doesn't work.

I've tracked it down to the virtual File table not being populated with info such as Name, Path and so on, but I don't know why. On NAV2009, this happens when "IF SourceFile.FINDSET THEN" line is run but it doesn't happen on NAV2013. Below is the code that works on NAV2009 but not on NAV2013.

Thanks!!!

CLEAR(SourceFile);
  SourceFile.RESET;
  SourceFile.SETRANGE(Path, InterfaceSetup."CSV Source File Location");
  SourceFile.SETRANGE("Is a file", TRUE);
  SourceFile.SETFILTER(Name, '%1|%2', '*.csv', '*.txt');
  
  
  IF SourceFile.FINDSET THEN
    REPEAT
      CLEAR(SalesTakingsCSVImport);
      SalesTakingsCSVImport.FILENAME := InterfaceSetup."CSV Source File Location" + SourceFile.Name;
      SalesTakingsCSVImport.RUN;

Comments

Sign In or Register to comment.