I have a form that displays the files in a certain folder (using the virtual file table), and a command button that executes some code. After the code is executed, the file can be deleted, so I use the ERASE command. All works well, the code does its thing with the file, and the file itself gets deleted. I want the list of files to be refreshed, but even though I do a CurrForm.UPDATE, the deleted file just won’t go away. It even goes so far that when I close the form and re-open it, it still shows the deleted file, even though it is no longer in the folder. Does anybody have any tips for me? I don’t care if I need to approach this a different way, but I need that list of files to refresh when I delete a file.
I have the same issue. If you close navision client and re-start it then it shows you the updated file(s)
For some reason it does not automatically refresh. You have to explicitly reset the filter and get the list again, no need for reopening the client. Here’s how I solved the problem (thanks to the golden tip from mibuso [:D]): So where I had this (which was not working): ---------------------------------- OnOpenForm File.SETFILTER(Path,‘C:\My Folder’); // note that a “” at the end will not work File.SETRANGE(“Is a file”,TRUE); OnPush CurrForm.UPDATE; -------------------------------------- I changed it to: ------------------------------------------ OnOpenForm File.SETFILTER(Path,‘C:’); IF Rec.FIND(’-’) THEN; File.SETFILTER(Path,‘C:\My Folder’); File.SETRANGE(“Is a file”,TRUE); OnPush File.SETFILTER(Path,‘C:’); IF File.FIND(’-’) THEN; File.SETFILTER(Path,‘C:\My Folder’); // no need for CurrForm.UPDATE -----------------------------------------