function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
adityaMorganadityaMorgan 

Java Script on Homepage

Hi,
In our org we have lot of javascript for hiding button or some other functions. As, salesforce will start removing javascript tags from homepage components our functionality will break down. We have been able to move some of the components on Visualforce Area but some components which involve complex javascript and are interacting with the entire homepage are not working as expected in Visualforce Area. Anyone please suggest me workaround for this. How to make sure that our functionality will work as expected.
Thanks.
PratikPratik (Salesforce Developers) 
Hi Aditya,

You can refer this:

https://help.salesforce.com/apex/HTViewSolution?urlname=Home-Page-Components-Changes-Starting-Summer-14&language=en_US

Thanks,
Pratik
adityaMorganadityaMorgan
Thanks, Pratik. 
But that doucment itself says the following :
8. On a record detail page, can I use JavaScript in a Visualforce home page component to hide or show content?

No, Visualforce pages are served on a different domain and are rendered in an iframe. They cannot interact with pages served in the Salesforce domain.

i have found this link, but not sure will it work.
http://salesforce.stackexchange.com/questions/38918/end-of-javascript-sidebar-workarounds

If you have anything better than the above link could you please let me know.
PratikPratik (Salesforce Developers) 
Hi Aditya,

Have you tried creating the custom link and excuting javascript in it as mentioned. Please post whatever results you get.

Thanks,
Pratik
adityaMorganadityaMorgan
Hi Pratik,
Sorry for late response. I have not yet tried it but one of my friend has used this link n it worked for him.. just let me know also how you are trying to achieve the rquirement may be u have some better way...
PratikPratik (Salesforce Developers) 
Hi Aditya,

I think the above Custom link with javascript approach should work. I will suggest you to try it on your org and if you face any issues post a comment.
Let us know how it goes.

Thanks,
Pratik