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
JohnPCutlerJohnPCutler 

Dynamically change Iframe height and/or display S-Control as related list?

Hello, and thanks in advance for your time. I have created an S-Control to implement a specialized related list. The list shows the Contact's (or Person Account's) roles on all Cases. This is an advantage over the current Cases related list which only shows Cases for whom the Contact is a the primary contact on the case.

The Problems
1) I am forced to display this S-Control in a field section, which doesn't look right. You'd expect to find this in a related list. Is there any way to display the S-Control as a related list instead?

2) I am forced to specifiy a height for the S-Control. This height is static. This means that I either need to turn on the scrollbar for the Iframe (which is ugly, and requires more user interaction and time), or make the Iframe unnaturaly high.

Any thoughts? Thanks again.

John

Update. I think this is a hack, but it works.

....
    resizeIframe(line_height);
    }
  }

    function resizeIframe(height) {
      var id = new String(window.name);
      var iframeElement = parent.document.getElementById(id);
      iframeElement.style.height = height + "px"
 }



Message Edited by JohnPCutler on 08-25-200712:01 AM

Message Edited by JohnPCutler on 08-25-200712:19 AM

rockchick322004rockchick322004
There is a sample snippet in the "Embedded Mash-Ups - Getting Started Samples" document that shows how to resize the iFrame.  It looks similiar to your code...
http://blogs.salesforce.com/features/files/salesforce_useful_scontrols.pdf

Look in the section titled "S-Controls that Include Snippets".

S-Controls are not currently supported as Related List items.  This is something that I hear every once in a while, but I have not seen a big push for from our customers or partners.  You might want to post this idea on IdeaExchange to see of others have this issue.
JohnPCutlerJohnPCutler
Thanks! I could have sworn I checked that, but now I notice I didn't read all the way to the end of the doc. I am basically a little stuck because the client I am working with wants to see all the Contact Roles a particular Person Account / Contact has on Cases. They deal with legal cases which have lots of players. Contact Roles is the right place for this, but of course there isn't a related list for this item. So, I've gone ahead and built an s-control when I swore I'd keep this project in the box!
sfdcfoxsfdcfox
You just need to embed the S-Control as part of the layout. The "Mass Edit Account Opportunity" S-Control uses this technique. Mind you, it doesn't appear as a related list, but for all practical purposes, it's close enough to perfect (after all, don't they just want to see the list?).
 
~ sfdcfox ~