Refreshing the File Table records

FrankandBeansFrankandBeans Member Posts: 5
Hi All,

I created an import interface to read through the "File" Table in Navision. It seems that there is a big delay ( a few minutes ) to refresh the records in this table so that it recognizes the files that are put into a folder. Is there a way to force a refresh for this table? ](*,)

Any help would be appreciated.

Thanks!

Comments

  • ara3nara3n Member Posts: 9,256
    yes filter on something else and do a find and then filter it back on original value.

    Search the threads. This has been discussed multiple times.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • FrankandBeansFrankandBeans Member Posts: 5
    Thanks alot for the help. I wasnt able to find anything on the topic. Im new to the boards though.
  • ara3nara3n Member Posts: 9,256
    FilePath2 :='C:\ABC\';
    Root := COPYSTR(FilePath2,1,3);
    CompletedPath :='C:\ABC\Completed\';

    CLEAR(MyFile2);
    MyFile2.RESET;

    MyFile2.SETRANGE("Is a file",TRUE);
    MyFile2.SETFILTER(Path,Root); //Refresh Virtual Table if data changed
    IF MyFile2.FIND('-') THEN; // Force Navision to retrieve the first file


    MyFile2.SETFILTER(Path,'%1',FilePath2);
    MyFile2.SETFILTER(Name,'%1', '@*.txt');
    MyFile2.SETRANGE("Is a file",TRUE);
    IF MyFile2.FIND('-') THEN BEGIN
    REPEAT
    CLEAR(MyDataPort);
    MyDataPort.FILENAME(FilePath2 + MyFile2.Name);
    MyDataPort.RUNMODAL;// DATAPORT.RUN(50038, FALSE)

    FILE.COPY(FilePath2+MyFile2.Name, CompletedPath+MyFile2.Name);
    WHILE EXISTS(FilePath2+MyFile2.Name)
    DO ERASE(FilePath2+MyFile2.Name);

    COMMIT;
    UNTIL MyFile2.NEXT = 0;
    END ELSE BEGIN
    MESSAGE ('All text files have been processed.');
    EXIT;
    END;

    http://www.mibuso.com/forum/viewtopic.p ... ry+refresh
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.