Hello,
Please help me solution to display popup alert by logic hooks
This logic hooks after save of Case, when Case set to Closed but Task in subpanel is not Completed, the logic hooks will popup alert and restrict save.
Thanks
Hello,
Please help me solution to display popup alert by logic hooks
This logic hooks after save of Case, when Case set to Closed but Task in subpanel is not Completed, the logic hooks will popup alert and restrict save.
Thanks
Hi,
You can use throw exception and popup the alert.Using exception you can restrict the save. Put below code in your logic hooks and check.
throw new SugarApiExceptionNotAuthorized('SUGAR_API_EXCEPTION_RECORD_NOT_AUTHORIZED',array('view'));
throw new SugarApiExceptionInvalidParameter(string_format(
$GLOBALS['app_strings']['LBL_UPLOAD_IMAGE_FILE_NOT_SUPPORTED'],
array($extension)
));
throw new SugarApiExceptionError('Unable to load field definition');
Another way is use the Validations of sugarcrm. Please check one of sugarcrm link http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.6/UI_Model/Views/Examples/Adding_Field…
Let me know if you need more help.
-BPATEL
Hi Bhavesh Patel,
Thank you very much, I'll try and feedback
Regards
Note that you won't be able to do it in an after_save logic hook as the Case bean would already be updated with the new values.
Additionally, if the above doesn't work, try using sugar_die("your message here")
Thank you very much, I'll try with before_save
Thank you very much, I'll try with before_save