Using the before_save logic hook, how can I stop the save from taking place and return an error message to the user instead? For example if there is invalid data. (I prefer to do this server side and not using javascript).
Thanks for the help!
Using the before_save logic hook, how can I stop the save from taking place and return an error message to the user instead? For example if there is invalid data. (I prefer to do this server side and not using javascript).
Thanks for the help!
You can not "cancel" the save but you can die inside your logic hook.
It's ugly but your logic hook could print an error and then call sugar_die()
or redirect using php header() function and then die.
Hi edanb
You can add a
Into your logic_hook function.PHP Code:header("Location: new_address");
Regards
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks