0

I have a VF page that sits on the Related tab of a Lightning record page basically displaying rollup fields about the related records:

<apex:page docType="html-5.0" standardController="Opportunity" title="Disbursement Summary" showHeader="true" sidebar="false">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<link rel="icon" href="../../favicon.ico"/>

<title>Disbursement Summary</title>
<apex:stylesheet value="{!URLFOR($Resource.SLDS214, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}" />
</head>

<body>
    <!-- REQUIRED SLDS WRAPPER -->
    <div class="vcc">
        <div class="myapp">
            <apex:form >
                <apex:pageBlock >
                <div class="slds-grid slds-wrap slds-grid--pull-padded">
                <div class="slds-col slds-size--1-of-3 slds-small-size--1-of-2 slds-medium-size--1-of-4">
                <apex:pageBlockSection columns="2">
                    <apex:outputField value="{!Opportunity.Total_Amount_Disbursed_Scheduled__c}" label="Total Disbursements"/>
                    <apex:outputField value="{!Opportunity.VCC_Percentage__c}" label="VCC Percentage"/>
                    <apex:outputField value="{!Opportunity.Number_of_Disbursements__c}" label="Number of Disbursements Made"/>
                    <apex:outputField value="{!Opportunity.VCC_Bank_Percentage__c}" label="VCC Bank Percentage"/>
                    <apex:outputField value="{!Opportunity.Balance_Outstanding__c}" label="Total Balance Outstanding"/>
                    <apex:outputField value="{!Opportunity.Other_Percentage__c}" label="Other Percentage"/>
                    <apex:outputField value="{!Opportunity.Loan_Limit_Code__c}" label="Loan Limit Code"/>
                    <apex:outputField value="{!Opportunity.Transmit_via__c}" label="Transmit Via"/>
                </apex:pageBlockSection>
                    </div>
                    </div>
                    <apex:pageBlockSection>
                    <apex:commandButton value="Refresh" onclick="window.location.href='/apex/DisbursementSummary" />
                    </apex:pageBlockSection>
                </apex:pageBlock>
            </apex:form>
        </div>
    </div>
</body>

</apex:page>

Right now, the refresh button reloads the visualforce page, but it does not update the fields displayed on the page. Is there any way I can have the fields update on the visualforce page without re-loading the entire lightning page?

1

Try calling an action in your refresh button from the standard controller and rerender your form, like:

           <apex:form id="theForm">
                <apex:pageBlock >
                <div class="slds-grid slds-wrap slds-grid--pull-padded">
                <div class="slds-col slds-size--1-of-3 slds-small-size--1-of-2 slds-medium-size--1-of-4">
                <apex:pageBlockSection columns="2">
                    <apex:outputField value="{!Opportunity.Total_Amount_Disbursed_Scheduled__c}" label="Total Disbursements"/>
                    <apex:outputField value="{!Opportunity.VCC_Percentage__c}" label="VCC Percentage"/>
                    <apex:outputField value="{!Opportunity.Number_of_Disbursements__c}" label="Number of Disbursements Made"/>
                    <apex:outputField value="{!Opportunity.VCC_Bank_Percentage__c}" label="VCC Bank Percentage"/>
                    <apex:outputField value="{!Opportunity.Balance_Outstanding__c}" label="Total Balance Outstanding"/>
                    <apex:outputField value="{!Opportunity.Other_Percentage__c}" label="Other Percentage"/>
                    <apex:outputField value="{!Opportunity.Loan_Limit_Code__c}" label="Loan Limit Code"/>
                    <apex:outputField value="{!Opportunity.Transmit_via__c}" label="Transmit Via"/>
                </apex:pageBlockSection>
                    </div>
                    </div>
                    <apex:pageBlockSection>
                    <apex:commandButton value="Refresh" action="{!Opportunity.reset}" rerender="theForm"/>
                    </apex:pageBlockSection>
                </apex:pageBlock>
            </apex:form>
1
  • {!Opportunity.reset} is not a valid action on the Opportunity standard controller, but using the quicksave action did the trick. Thank you! Here's what my updated command button looks like: <apex:commandButton value="Refresh" action="{!quicksave}" rerender="theForm" /> – TheDevAdmin Feb 9 '17 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.