0

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

s it possible to add javascipt to the "parent" Account page without adding Custom Button?

John
  • 454
  • 2
  • 5
  • 18

2 Answers2

1

I'm not aware of any way to run javascript on a page other than by using a button (or maybe a link as a field), though it'd be good to know if there is one but I highly doubt it would be available, or if it is, supported.

Would overriding the Account view page with a full visualforce page be an option where you use an <apex:detail> tag to get the standard fields etc.?

Matt Lacey
  • 8,227
  • 35
  • 58
1

Remember that Visualforce components on page layouts occur as iframes. If the domains match up, which may or may not be the case - you could inject JavaScript from the iframe to the parent.

This may give more details: Inject javascript function into parent window from iframe

Community
  • 1
  • 1
joshbirk
  • 181
  • 5