Here is another of my handy code snippets used to hide the subsections of a standard layout.
Embed a vf page inside the standard layout and add this jQuery logic.
and #kachow
Please note: Salesforce may change the css at any point so you just want to keep that in your back pocket and use at your own risk.
Embed a vf page inside the standard layout and add this jQuery logic.
<script>
//This is the magic that hides all of the subsections
//I love jQuery
j$(document).ready(function() {
j$('.hideListButton', parent.document).addClass("showListButton");
j$('.pbSubsection', parent.document).slice(1).css("display","none");
j$('.hideListButton', parent.document).removeClass("hideListButton");
if({!Account.Recordtype.name='internal'}){
j$('iframe[title=apex_page_name]', parent.document).css("height","200px");
}else{
j$('iframe[title= apex_page_name ]', parent.document).css("height","0px");
}
});
</script>
and #kachow
Please note: Salesforce may change the css at any point so you just want to keep that in your back pocket and use at your own risk.
How did you get this to work? In my scenario I get the error "Unsafe JavaScript attempt to access frame" since VF inline is put in an iframe you get two different URLs: https://cs12.salesforce.com and https://c.cs12.visual.force.com
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteAlso for me it's not working.
ReplyDeleteThis comments I found on this issue in SF boards:
"The Iframe that contains the VF page comes from a different server to the standard page. When you attempt to access/modify information from the main page, the browser considers this cross site scripting and blocks it."
The Top Casino Sites for New Players | CasinoNow
ReplyDeleteThe Casino List — The Best New Online Casinos for New dafabet Players ✓ Casino Review ✓ Free Spins ✓ Jackpot City Bonus. Are 메리트카지노 you interested in 인카지노 joining us?