How do you add js to a record edit view in Sugar7?

before, I will wrote some js files and include them in editviewdef.php,and everything was fine,like 'displayParams' , $.ajax to get values .However ,when I fall in Sugar7,it seems that even I want to alert('hello') is a problem.

Now, I hope someone kind could give an method to include js file . specifically,in account ,I can use formula to make field A = filed B+ field C, but the field A can not be edit for using formula.I would use js to calculate it in th pass ,and certainly it could be edit .Now, how should I do?

Thanks


Parents
  • If you customize the record view (clients/base/views/record) HandleBars for example and include a JavaScript tag there for example. A better solution is to extend the controller and try to add all module specific clientside functionality there.

    But for the issue you try to solve: you want that the value of field A is equal to B+C. This can be done by creating a formula for Field A, but you do not want to do this because it makes the field not editable anymore (so Field A is some sort of default value?) ? In that case then maybe a Logic Hook might be a better solution, for example a before_Save logic hook which sets the appropriate value for Field A before it is saved.
  • You are so kind ,thanks again.

    I saw this document before,but it looks like an onclick event ,I am not sure how to write an onchange event ,could you give some more explain?


Reply Children
No Data