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
Igor GolikovIgor Golikov 

Attache script to the main page.

I have added my visualforce page to Account page and found that it can set only fixed height. I wrote javascript solution for auto height. First part I added to main Account page by adding new button with {!REQUIRESCRIPT("my_scipt_here")}, second part I added to visualforce page.

 

Is it possible to add javascipt to the "main" Account page without adding Custom Button?

Best Answer chosen by Admin (Salesforce Developers) 
RustanRustan

Ah, now I get it. How about just replacing the whole Account record page with a visualforce page?

All Answers

RustanRustan

Create a visualforce page with a script. Add the visualforce page in the pagelayout but make the size be pretty much 0 so it won't show anything and take up space. The script wll run whenever the user goes to the page.

Igor GolikovIgor Golikov

but, visualforce page will be added in iframe, and javascipt will be "inside" iframe. I need 2 parts, one scipt on the parent page, one scirpt in iframe (visualforce) page.

 

RustanRustan

Ah, now I get it. How about just replacing the whole Account record page with a visualforce page?

This was selected as the best answer