+ Start a Discussion
RichardC.ax220RichardC.ax220 

How to set window size for S-Control invoked thru URLFOR

I have a custom link that opens an S-Control in a new window using URLFOR to pass it some arguments. I would like to set the window size while I'm at it. Currently, the custom link opens a larger window than I want. I currently have the S-Control resize itself. However, the user sees that resizing and I'd rather avoid that. I could easily pass it the window dimensions as arguments, if they exist and someone would tell us their names :smileywink:
sfdcfoxsfdcfox
You can't do that if the custom link has a behavior of URL. Instead, change the behavior to Execute JavaScript, and use a simple JavaScript:
window.open("{!urlfor($SControl.My_SControl,null,null)}","","top=100,left=100,width=400,height=400,status=yes,toolbar=yes")
Now, your S-Control will open with the desired width, height, and features, and will be compatible with all modern browsers.

~ sfdcfox ~
 

RichardC.ax220RichardC.ax220

sfdcfox,

Thanks!
The Javascript window.open works, and I can pass parameters through URLFOR.