Forums

Deleting a record from the database.

middo 22 Feb, 2012
Ok, I've worked my way through the tutorials and so far I've got:
[list]
  • the Add Record form

  • the multiple record load form and Edit, but with the addition of a 'Delete' link

  • the Add Record form updating successfully.

  • a Confirm Delete Record form, which is simply a copy of the Add Record form with cosmetic changes.
  • [/list]

    Now: All I need to do is insert whatever code I need to remove the record from the database table. Is this as simple as writing some SQL like 'DELETE FROM <tableName> WHERE cf_id = {cf_id}' and somehow making ChronoForms do the rest for me?

    I've searched through the articles here and can't find anything that comes close. I do note that in the DB Operations, there is a DB Save. Is there likely to be a DB Delete that we can just drag across?
    GreyHead 22 Feb, 2012
    Hi middo,

    There isn't a DB Delete but it is as simple as creating a little form with a Custom Code action and the code snippet to delete the record. Personally I prefer to mark them as unpublished, at least to start with, so that the deletion is non-destructive.

    Bob
    This topic is locked and no more replies can be posted.