Options

How can I update the 'FIle' Table?

RaulRaul Member Posts: 14
edited 2002-10-02 in Navision Financials
I'm using the 'File' Table to edit a directory, but when
I move some files to another directory Navision does not update.

The way it updates is restarting the navision client.

Any suggestion?

Thanks a million
Raúl.

Comments

  • Options
    DennisDennis Member Posts: 25
    I think a currform.UPDATE should do the trick, but I haven't tried it.




    Dennis van Es
    PerCom: Research & Development BV
    The Netherlands
    Dennis van Es
    Qwinsoft BV
    The Netherlands
  • Options
    LudoLudo Member Posts: 14
    Haaaa,

    this is a though one ... I 'll try to explain how you can solve the problem.

    When using the virtual table file you can show entries of a certain folder by setting a filter on the 'path' field.
    Example : suppose you have a folder 'data' on drive C. Then you can write :

    setrange(path,'c:\data');

    Now if you want to get it updated after an action of a user (or you implement a 'refresh' button) you should use :

    setrange(path,'c:\data\');

    in fact you should allways switch between a filter with a backslash on the last position or not ... put it in a little algorithme :

    - test for the last position,
    - if this is a backslash then remove the backslash and apply the filter again
    - if this is a another char. add the backslash and apply the filter again


    Hope this works,

    LVDE


    [This message has been edited by Ludo (edited 25-02-2000).]
  • Options
    Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Ludo:
    setrange(path,'c:\data\');
    <HR></BLOCKQUOTE>

    Wow, what a nice trick!

    Good work Ludo.


    [This message has been edited by Luc Van Dyck (edited 25-02-2000).]
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Options
    RaulRaul Member Posts: 14
    Yes,it works really fine. <img border="0" title="" alt="" src="images/smiles/icon_wink.gif" />

    Thanks.

    OnPreDataItem()
    IF slash THEN
    BEGIN
    FileTable.RESET;
    FileTable.SETRANGE(FileTable."Is a file", TRUE);
    FileTable.SETRANGE(FileTable.Path, StrPath + '\');
    END
    ELSE
    BEGIN
    FileTable.RESET;
    FileTable.SETRANGE(FileTable."Is a file", TRUE);
    FileTable.SETRANGE(FileTable.Path, StrPath);
    END;

    OnAfterGetRecord()

    dportPathFile.FILENAME(StrPath + '\' + FileTable.Name);
    dportPathFile.RUN;
  • Options
    BGIBGI Member Posts: 176
    This is indeed a nice trick.
    But what if you don't have a path ?

    The update works fine if you change between 'c:\data' and 'c:\data\'.
    But what if i want to update the view on the root directory ?
    It doesn't work with 'c:\' and 'c:' because if you omit the path navision defaults to the current directory.
    How do i solve thisone ?

    Rgds
    Benny
    Rgds
    Benny Giebens
Sign In or Register to comment.