+ Start a Discussion
ZombiePrawnZombiePrawn 

(Summer 15) java script in HTML Home Page Component

Hi, 

We currently have javascripts within a  home page component:

 - 1) Is to inject a javascript on a lookup field to override calling of standard search window  and replace it with a vf page to widen the search functionality. (im trying to explore on the enhanced lookup as a replacement but i can only search through id and name columns. no luck so far)

 - 2) injected a javascript for hiding a field while on edit mode.

Before i explore on the Visualforce area (a new type of custom component), i would like to ask if there are ways to apply our current
funtionality. really need your help..

Thanks,
Best Answer chosen by ZombiePrawn
bob_buzzardbob_buzzard
I don't think you'll be able to do this any more regardless of whether you use VF or a standard home page component.  As of summer 15 Salesforce will start removing unsupported code from homepage components, which means JavaScript injection will stop working.  Visualforce home page components won't be able to access the DOM of the standard page as they come from a different server and will be blocked by the browser's same origin policy.  

All Answers

bob_buzzardbob_buzzard
I don't think you'll be able to do this any more regardless of whether you use VF or a standard home page component.  As of summer 15 Salesforce will start removing unsupported code from homepage components, which means JavaScript injection will stop working.  Visualforce home page components won't be able to access the DOM of the standard page as they come from a different server and will be blocked by the browser's same origin policy.  
This was selected as the best answer
ZombiePrawnZombiePrawn
Thanks for your response Sir!

We've also addressed this by using the enhanced lookup feature. 

We have one remaining issue , as we also relied on this approach(javascript injection) to block populating values for contact's mailing address if an account is selected when creating/updating a contact record. would appreciate if there are alternative workaround on this that does not include injections. Thanks in advance!