Delete All Data of modified tables using batch report!!

prateekarya2011prateekarya2011 Member Posts: 40
Dear All,
I just wanted to delete all the data in modified tables or the tables that i have created.
1 solution that i got is to create the record variable of all the tables in a batch report and then call recordVariableOfTable.Deleteall;
Its a hectic task to do..

Please suggest.

Thanks in advance ;-)
:lol:

Comments

  • geordiegeordie Member Posts: 655
    You can use a report to fetch Object table, filtering by Type = Table, ID, version list and so on...
    Then use a RecordRef variable to refer to each of those ones and delete them records.
  • lvanvugtlvanvugt Member Posts: 774
    Or maybe a bit more save (you might make an error in setting the filter right in geordie's solution):

    Create a ProcessingOnly report with a DataItem per table involved and put DELETEALL in each OnPreDataItem trigger.

    In this way you're more sure in which tables you will delete all records.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • prateekarya2011prateekarya2011 Member Posts: 40
    @lvanvugt and @geordie Thanks to both of you..
    for the ideas
    :D =D> \:D/
  • vaprogvaprog Member Posts: 1,141
    :shock: That's a strange undertaking!

    What do you plan to do with the remaining, now likely inconsistent, data?

    You should
    • use the triggered version of the DELETEALL function -> DELETEALL(TRUE)
    • probably not delete all the data in standard tables modified by you but rather only delete the fields you have added and possibly modify the data of standard fields you added, data first then the table field after that. Delete or transform the fields contents of standard fields you abused.

    Or else you'd probably be better off transferring the data you wish to keep to a new, empty database, reposting any posted entries.
  • prateekarya2011prateekarya2011 Member Posts: 40
    Thanx Vaprog :D
Sign In or Register to comment.