Hello experts
I want to run some JavaScript code when page (Detail view of Task Module load). Where should i write this code so that it run on load of detail view . Please help
#sings Goooooogle (or DuckDuckGo) is your frieeeeeend
There are lots of tutorials on how to do this! Some are about the EditView and some are for DetailView.
https://community.sugarcrm.com/thread/27141
Have fun!
Thank you so much sir it work one more question please when i do any change in JS code then every time i have to do rebuild and repair ? like repair js files and repair minified js files etc please clear this
Iām a woman.
If you go to Admin Panel > System Settings and enable Developer Mode
This will stop the application from caching the view defs, so if you change your JS it should be applied after a quick refresh (or hard refresh) of the browser window without needing to do RepairJS.
I recommend after you have completed your development/changes then you untick it as the caching does improve performance speeds.
Hope that helps.
Ok sorry maāam .But developer mode is on even my changes are not reflecting .
I am just changing the message āHello worldā to āHelloā It shows āHello worldā.
See this please: https://www.loom.com/share/e5f6a2633b9a4af59af147c957c64b9a
I think, that you should clean cache (delete local js files) of your browser.
Hmm, that doesnāt sound normal. Can you send a screenshot that the development mode is enabled.
What solution did you go with to implement the javascript/alert?
Can you provide us the DetailView defs, the javascript file.
Usually I just need to do the hard refresh (Shift + F5) when developer mode is on/off
No Problem now its working fine. Thank you maāam
Hi.
I want to run a javascript in detail view. I have succeeded in that too. But the javascript code I added, runs 2 times each time.
For example, Iāve included a javascript file that just throws a warning. The code is below.
Every time I refresh the page, this warning message comes up 2 times in a row.
why could it be?
I edited detailviewdefs.php file as follows.
custom/modules/Contacts/metadata/detailviewdefs.php
......
'includes' =>
array (
0 =>
array (
'file' => 'modules/Contacts/Contact.js',
'file' => 'custom/modules/Contacts/js/mytest.js',
),
),
...........
Contents of my mytest.js file;
custom/modules/Contacts/js/mytest.js
$(document).ready(function(){
window.alert("this is test");
});
chequea la funciĆ³n unbind()