⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

no delete rows, only change status



iezpinoza

iezpinoza
  • profile picture
  • Member

Posted 22 June 2012 - 17:50 PM

first: sorry for my bad English

no delete rows, only change status

Spanish: (Como podría hacer para que cuando se elimine un registro realmente no se elimine, solo cambie su status)

fdias

fdias
  • profile picture
  • Member

Posted 22 June 2012 - 21:23 PM

It's easy.

Use callback_before_delete:

http://www.grocerycr...k_before_delete

If you don't want to log this info and really update what you can also do is use unset_delete:

http://www.grocerycrud.com/documentation/options_functions/unset_delete

Then you create an action named delete to update the record as you wish using the add_action function:

http://www.grocerycrud.com/documentation/options_functions/add_action

I hope this helps.

webmin_1800

webmin_1800
  • profile picture
  • Member

Posted 02 February 2013 - 09:10 AM

I know it's an old post but I'm interested of this feature: changing status as [i]inactive[/i] (not display in front page) instead deleting records, with the possibilities to activate records later.

victor

victor
  • profile picture
  • Member

Posted 02 February 2013 - 10:02 AM

Hi webmin_1800 and welcome to the forum!
You can use the "unset_delete" function and the "add_action",
All function is here

Jamal Javed

Jamal Javed
  • profile picture
  • Member

Posted 22 April 2016 - 08:29 AM

I am facing the same problem I dont want to delete the record from db just want to update the status from 1 to zero but instead of using unset_delete can't I achieve this by chaning the defualt delete query. Please need help.