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
skiptomylou11skiptomylou11 

Embedded VF page - How to refresh the parent (standard) page?

Hi,

 

I have embedded a VF page into a standard Salesforce page for Accounts.

 

The VF page contains input fields as well as apex:relatedLists. 

Whenever I click on a link (e.g. a lookup field) or try to create a new related list entry via the 'New' button only the section of the VF page is reloaded an shows the lookup record or entry mask for a new related list item.

 

How can I make the whole Account (parent / host) page reload?

I tried target='_top' in different areas but I could not make it work.

 

Any ideas?

Many thanks! 

SeAlVaSeAlVa

what about Javascript?

top.location='/xxx?param1=yyy&param2=zzz';

 

Salesforce WizardSalesforce Wizard

Would JS work in this case? I thought it was not allowed because Visualforce and standard page layouts are on two different domains.

SeAlVaSeAlVa

I think that, as long as you don't try to touch anything on the top frame code, it should work.

I can't try it right now, but is easy to check. (If you check, do it with several browsers, as they implement this part of the security in a wide different way)

skiptomylou11skiptomylou11

Thanks SeAIVa,

 

I'm struggling a bit with the javascript command....

Below I have included my VF page code.

If I want to reload the entire host (account) page when clicking on for instance the apex:relatedlist section (e.g. to create a new entry) where would I need to include the top.location command?

 

Many thanks for your help!!! 

 

<apex:page standardController="Account" showHeader="false" sidebar="false" standardStylesheets="true" tabStyle="account" >
    <apex:tabPanel >
        <apex:tab label="Competitor" rendered="{!(Contains(Account.Account_Roles__c,'Competitor')) }">
            <apex:form > 
            <apex:commandButton style="margin-left:400px" action="{!quickSave}" value="Save" />
              <apex:pageblock mode="inlineedit">
               <apex:pageBlockSection columns="1"> 
                <apex:outputfield value="{!Account.Competitor_Site__c}" />
                <apex:outputfield rendered="{!(Account.Competitor_Site__c = True)}" value="{!Account.Site_Capacity__c}" />
                <apex:outputfield rendered="{!(Account.Competitor_Site__c = True)}" value="{!Account.Site_Capacity_of_cars_year__c}" />
                <apex:outputfield rendered="{!(Account.Competitor_Site__c = True)}" value="{!Account.P_Employees__c}" />              
               </apex:pageBlockSection>                                    
               </apex:pageblock>
            </apex:form> 
           <apex:relatedList rendered="{!(Account.Competitor_Site__c = False)}" list="Awarded_Contractors_Bidders__r" />  
           <apex:relatedList rendered="{!(Account.Competitor_Site__c = False)}" list="CI_Object__r" />  
           <apex:relatedList rendered="{!(Account.Competitor_Site__c = True)}" list="Involved_sites__r" />  
        </apex:tab>
        <apex:tab label="Financial Institution" rendered="{!(Contains(Account.Account_Roles__c,'Financial Institution')) }">
        </apex:tab>
        <apex:tab label="Agent" rendered="{!(Contains(Account.Account_Roles__c,'Agent')) }">
        <apex:relatedList list="Agents_Division_Information__r" />  
        </apex:tab>
    </apex:tabPanel>
</apex:page>