On Mar 2, 7:20 am, krishan <[email protected]> wrote:
> Does anyone know how to customize this error message in user friendly
> way? I actually need to inform user that record can not be deleted
> because he violated foreign key rules.

I usually do this sort of checking in the model validation or in the
delete controller action before the deletion is attempted. Something
like a find('count') or similar method to to check if the ID of the
record to be deleted exists in a FK in some other table or record. You
might also try the model's 'del' method which has a 'cascade' option
(http://book.cakephp.org/view/690/del).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to