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
SubashKumarSubashKumar 

Hiding VF page in standard page

Hi,

 

I have embedded a VF page in account detail page layout. All Account detail page should show the VF page. How ever each user should have the ability to turn on or turn off the VF page. This property will be controlled by a flag in User object. No separate profile will be assigned to show the VF page.

 

I though that using javascript, I can set the height of the iframe  which renders the VF page. If I set the height this can be achieved. How ever There is permission error as there domains are different.

 

Can any one suggest any idea to achieve this?

 

Thanks,

Subash.

b-Forceb-Force

create a Narrow HTML component,

add this HTML in Home page component

 

<div id="demoContainer">
<script language="JavaScript">
var pa=document.getElementById("demoContainer").parentNode.parentNode; pa.style.display = "none";
var currentLocation=window.location;var ur=currentLocation+"";
var recordId=ur.split(".com/")[1];
/**
If first three character of recordId=='001', then this is detail account page 
By using ajax toolkit , retrieve current user information (your flag info)

if is okay
then create new html  (div + iframe[will load vf page ])
append this html to appropriate parent
to find suitable parent to append use firebug + Mozila tool 
Done 
**/
</script>
</div>

 

This  is just trick to achieve your business need.  

 

above code will hide this section from home page :)  too

So User will not experiance any UI change

 

Hope this will help you 

 

Cheers,

Bala

Pradeep_NavatarPradeep_Navatar

If you want to hide the visual force page on the basis of profile then in this you can invoke the page property                              'rendered'.

 

Try out the sample code given below :

 

<apex:page rendered="{!if($Profile.Name != 'System Administrator',$Page.testconfirm,URLFOR($Action.Account.Tab, $ObjectType.Account,null,true))}">

 

Hope this helps.