show Error on the edit view and detail view

This is small problem is bugging me …
where to write the code ???
what to write for show is error on the edit view and detail view???

Question:
convert_c is a dropdown value is “yes” and “no”
Payment_status is dropdown value is “pending” and “completed”.

When convert_c is “yes” and payment_status is “Pending”.

click on save error has to show "Payment is not completed "

Please help …

Thank you.

As I have already told you in another thread you should start reading the manual:
https://docs.suitecrm.com/developer/logic-hooks/
http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Module_Framework/Logic_Hooks/Module_Hooks/before_save/
Instead of before_save, you may use a different type of logick hook. You will just have to echo the javascript. The javascript may be inside your logic hook method or in a separate file.

I also pointed you at a custom module wich is a basis to create easily logic hooks.
https://github.com/audoxcl/SugarCRMLogicHooks

Modify the code per your needs and then you just have to upload it with Module Loader.

Alternatively you can follow these guides (or many more):
https://community.sugarcrm.com/thread/21056
or
https://stackoverflow.com/questions/22176744/how-to-add-custom-javascript-code-to-validate-field-in-contacts-module-in-sugarc
or
https://stackoverflow.com/questions/15254673/sugarcrm-how-to-get-popup-when-click-on-save-button/15259436#15259436

1 Like