Dialog box for progress during deleteall

suvidhasuvidha Member Posts: 117
Hi,
i have a report which deletes records in a table.
Since it takes some time to delete the records i want to show a progress dialog.
i am using deleteall function.
any ideas?
thank you

Answers

  • krikikriki Member, Moderator Posts: 9,110
    With a deleteall, it is not possible to use a dialog box.
    Or you can use one to show that it is deleting but it will NOT show a progress. Like this:
    Window.OPEN('Deleting');
    
    recSomeTable.DELETEALL(...);
    
    Window.CLOSE;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • garakgarak Member Posts: 3,263
    edited 2008-08-27
    if using deleteall you cant use a progressbar dialigbox.

    You can delete the recs in a loop (here you can create a progressbar), but this is not so fast like deleteall.

    Other:
    You popup a window where you write
    Windows.Open('Delete Recs');
    Rec.deleteall;
    Windows.close();
    

    But there is also no progressbar

    Regards
    Do you make it right, it works too!
  • garakgarak Member Posts: 3,263
    Hehe, Kriki, nice idea ;-)
    Thjis could be an idia of mine :-D
    Do you make it right, it works too!
  • afarrafarr Member Posts: 287
    There are a few posts about progress bars, e.g.
    http://mibuso.com/forum/viewtopic.php?t=23896
    http://mibuso.com/forum/viewtopic.php?t=21386

    You need some variable, say NumDeleted, to keep track of how many records have been deleted so far; and a line of code in the OnDelete trigger to increment this variable.

    This code will only get executed if your command is DELETEALL(TRUE).

    DELETEALL, or the equivalent DELETEALL(FALSE), do not execute the code in the OnDelete trigger, but that means that they should be more efficient, so the deletion might take even more time if you change to
    DELETEALL(TRUE) - you'll have to see how much performance is affected, and whether it is worth it.
    Alastair Farrugia
  • suvidhasuvidha Member Posts: 117
    Thank you all..... it helped :D
Sign In or Register to comment.