Pass the table to do sth. like table.deleteall

mart1n0mart1n0 Member Posts: 123
Is there a way to delete all records in a table where you pass the table to be emptied?

I have the number and name of the table to empty stored as a record in another table and want to go trough these records and for each record delete all of the records in the table the record represents.

I already figured out how to delete tables and fields programatically and how to create fields programatically but I have no idea how to do this one.

Answers

  • webweb Member Posts: 102
    Did you try doing this?
    Record.DELETEALL
    

    Create a new code unit and place it on the OnRun trigger.
  • girish.joshigirish.joshi Member Posts: 407
    You use a recordref variable.
    RecordRef.open( TableNo) ; 
    RecordRef.deleteall ;
    
  • mart1n0mart1n0 Member Posts: 123
    What can I say girish.joshi?

    Works like a charm with RecordRef!
  • girish.joshigirish.joshi Member Posts: 407
    You're welcome :)
Sign In or Register to comment.