You need to sign in to do that
Don't have an account?
Karen Yetter
Visualforce section returns entire page on Save
I have added a visualforce page w/ tabs as a section on an account page. Records can be updated. \
However, when I hit the save button, it brings up the entire salesforce page within the section. How can I have it return the original visualforce page in the section?
However, when I hit the save button, it brings up the entire salesforce page within the section. How can I have it return the original visualforce page in the section?
<apex:commandlink action="{!save}" value="Save" target="_top"/>
All Answers
tabStyle="account" >
<style>
.activeTab {background-color: #236FBD; color:white;
background-image:none}
.inactiveTab { background-color: lightgrey; color:black;
background-image:none}
</style>
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Contact Details" name="AccDetails" id="tabdetails">
<apex:form >
<apex:pageBlock title="Contact Details">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Account.Primary_Contact__c}"/>
<apex:inputField value="{!Account.Lead_Analyst__c}"/>
<apex:inputField value="{!Account.Account_History__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
<apex:tab label="Current Service Offerings" name="AccOfferings" id="tabOfferings">
<apex:form >
<apex:pageBlock title="Contact Details">
<apex:pageBlockSection columns="1">
<apex:outputField value="{!Account.Current_Services__c}"/>
<apex:inputField value="{!Account.Flex_Program_Description__c}"/>
<apex:inputField value="{!Account.Attachments_to_Membership__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
<apex:tab label="History of Account" name="AccHistory"
id="AccHistory">
<apex:relatedList subject="{!account}"
list="Primary_Contact_Histories__r" />
<apex:relatedList subject="{!account}"
list="Contract_Signers__r" />
<apex:relatedList subject="{!account}"
list="opportunities" />
</apex:tab>
<apex:tab label="Current Tasks" name="Tasks"
id="Tasks">
<apex:relatedList subject="{!account}"
list="OpenActivities" />
</apex:tab>
<apex:tab label="Who Pays For Relationship" name="PayRel"
id="PayRel">
<p style="font-size: 15px;"><b>Who are on the invoices?</b> (list of everyone who received an invoice)</p>
<apex:relatedList subject="{!account}"
list="Invoice_Party_Histories__r" />
<p style="font-size: 15px;"><b>Who is behind the budget(s)?
</b></p>
<apex:relatedList subject="{!account}"
list="Behind_Budgets__r" />
<p style="font-size: 15px;"><b>Who are backups for each budget holder?
</b></p>
<apex:relatedList subject="{!account}"
list="Budget_Holder_Backups__r" />
</apex:tab>
<apex:tab label="Key Stakeholders / Influencer" name="Stakeholders"
id="Stakeholders">
<p style="font-size: 15px;"><b>Who is currently aware of the services?</b></p>
<apex:relatedList subject="{!account}"
list="AwareUsers__r" />
<p style="font-size: 15px;"><b>Who is not currently a user but who needs to see value?</b></p>
<apex:relatedList subject="{!account}"
list="nonuser_values__r" />
<p style="font-size: 15px;"><b>Who are targets that we are working with in this relationship?</b></p>
<apex:relatedList subject="{!account}"
list="Account_Targets__r" />
</apex:tab>
<apex:tab label="Value of Relationship" name="Value"
id="Value">
<apex:form >
<apex:pageBlock title="Contact Details">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Account.Format_of_Value_Delivery__c}"/>
<apex:inputField value="{!Account.Meeting_Cadence__c}"/>
<apex:inputField value="{!Account.Requests_made_by_the_client__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
<apex:tab label="Company Background" name="CompanyBackground"
id="CompanyBackground">
<apex:form >
<apex:pageBlock title="Contact Details">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Account.Company_Description__c}"/>
<apex:outputField value="{!Account.Current_Annual_Report__c}"/>
<apex:outputField value="{!Account.Investor_Presentation__c}"/>
<apex:outputField value="{!Account.Company_Overview__c}"/>
<apex:outputField value="{!Account.Product_Overview__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
<apex:tab label="Engaged?" name="Engaged"
id="Engaged">
<apex:form >
<apex:pageBlock title="Are we engaged in:">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Account.Annual_Strategic_Planning__c}"/>
<apex:inputField value="{!Account.Annual_Conference__c}"/>
<apex:inputField value="{!Account.PR_Communications_Team__c}"/>
<apex:inputField value="{!Account.Any_Board_Committees__c}"/>
<apex:inputField value="{!Account.Board_Level_Activity__c}"/>
<apex:inputField value="{!Account.Publications_Strategy_Pieces__c}"/>
<apex:inputField value="{!Account.Survey_Based_Marketplace_Insights_Busi__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
<apex:tab label="Have We Contacted...?" name="Contacted"
id="Contacted">
</apex:tab>
</apex:tabPanel>
</apex:page>
<apex:commandButton action="{!save}" value="Save" target='_Top'/>
Error: Unsupported attribute target in <apex:commandButton>
<apex:commandButton action="{!save}" value="Save" target="_Top"/>
Error: Unsupported attribute target in <apex:commandButton>
I wonder if it has anything to do with me being on Professional Edition.
<apex:commandButton action="{!save}" value="Save" onComplete="refreshParentWindow('{!Account.id}'); return true;" />
<script type="text/javascript">
function refreshParentWindow(id)
{
window.top.location.href = '/' + id;
}
</script>
<apex:commandlink action="{!save}" value="Save" target="_top"/>