This topic is locked

before delete

2/28/2008 12:14:39 PM
PHPRunner General questions
G
garethp authorDevClub member

Hello - could I please ask for some more help...
I have a table part with fields partid, description, archive
If a user clicks delete on the list page I would like to check that if archive =1 then the record is not deleted else the record is deleted.
I presume this can be done with a before delete event but I just can not work out the code!
Please can you help.
Thanks

A
alang 2/28/2008

Try following in before record deleted event code:
if($deleted_values["archive"] == '1')

return false;

else

return true;

G
garethp authorDevClub member 2/29/2008

great stuff - thanks so much for response