0

This is one of the issue which i am trying to find the reason. The standard account detail page refreshes for three times automatically on every time an account details getting loaded. This is happening every time whenever i click an account and trying to see its detail. After that 3 refresh, the page settles down calmly.

I have two inline visualforce pages embedded in the account detail page. Could that be a reason for this automatic refresh? Is there any other reason that could trigger the page refresh on the page load?

Could the getter methods in the controllers triggers page refresh automatically while the page loads?

Any thoughts on how to fix or any workaround please?

Inline VF Page 1

<apex:page standardController="Account" extensions="OpenDocumentsController" readOnly="true" showHeader="false" sidebar="false">

<apex:stylesheet value="{!URLFOR($Resource.jQueryDataTablesZip, 'css/jquery.dataTables.css')}"/>

<style type="text/css">
.sorting {
    background: #f2f3f3 url('{! URLFOR($Resource.jQueryDataTablesZip, 'images/sort_both.png') }') no-repeat center right !important;
    padding-right: 20px !important;
}
.sorting_asc {
    background: #f2f3f3 url('{! URLFOR($Resource.jQueryDataTablesZip, 'images/sort_asc.png') }') no-repeat center right !important;
    padding-right: 20px !important;
}
.sorting_desc {
    background: #f2f3f3 url('{! URLFOR($Resource.jQueryDataTablesZip, 'images/sort_desc.png') }') no-repeat center right !important;
    padding-right: 20px !important;
}
.sorting_asc_disabled {
    background: #f2f3f3 url('{! URLFOR($Resource.jQueryDataTablesZip, 'images/sort_asc_disabled.png') }') no-repeat center right !important;
    padding-right: 20px !important;
}
.sorting_desc_disabled {
    background: #f2f3f3 url('{! URLFOR($Resource.jQueryDataTablesZip, 'images/sort_desc_disabled.png') }') no-repeat center right !important;
    padding-right: 20px !important;
}
table.dataTable tr.odd { background-color: white; }
table.dataTable tr.even { background-color: white; }
table.dataTable tr.odd td.sorting_1 { background-color: white; }
table.dataTable tr.odd td.sorting_2 { background-color: white; }
table.dataTable tr.odd td.sorting_3 { background-color: white; }
table.dataTable tr.even td.sorting_1 { background-color: white; }
table.dataTable tr.even td.sorting_2 { background-color: white; }
table.dataTable tr.even td.sorting_3 { background-color: white; }
.dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate { padding: 10px; }

</style>

    <c:LoadingBox />
    <!-- <c:PageLoadingAnimation /> -->
    <body>

     <apex:pageMessages />
    <apex:form id="myForm">
    <div id="container" style="float:left;width:75%">
            <apex:commandButton action="{!ViewOpenSalesOrders}" value="Open Sales Orders" id="btnOpenOrders" style="{!(If(displayOpenSalesOrders,'color:red;','color:black;'))}" status="loadStatus" rerender="myForm"/>
            <apex:commandButton action="{!ViewOpenDeliveries}" value="Open Deliveries" id="btnOpenDelivery" style="{!(If(displayOpenDeliveries,'color:red;','color:black;'))}" status="loadStatus" rerender="myForm"/>
            <apex:commandButton action="{!ViewOpenInvoices}" value="Open Invoices" id="btnOpenInvoices" style="{!(If(displayOpenInvoices,'color:red;','color:black;'))}" status="loadStatus" rerender="myForm"/>
            <apex:commandButton action="{!ViewARNotes}" value="Account Receivable Notes" id="btnARNote" style="{!(If(displayARText,'color:red;','color:black;'))}" status="loadStatus" rerender="myForm"/>
            <span id="InfoText" style="width:300px;padding-left:5px;color:red;"> Please click the tabs to see the details.</span>
    </div>

    <div style="width:100%">
        <apex:pageBlock title="Open Sales Orders" rendered="{!displayOpenSalesOrders}">
            <table width="100%">
                <tr>
                    <td width="15%"><b>Number of Sales Orders:</b></td>
                    <td width="5%" align="left">{!SONumOf}</td>     
                    <td width="8%"><b>Total Amount:</b></td>
                    <td width="10%" align="left">
                        <apex:outputText id="totamt" value="{0,number,currency}">
                            <apex:param value="{!SOTotalAmount}" />
                        </apex:outputText>
                    </td> 
                    <td style="width:40%; text-align:right; padding-right: 7px"><apex:commandButton action="{!GenerateCSV}" title="Download CSV" id="btnOpenSalesCSV" value="Download" image="{!URLFOR($Resource.UtilityImages, 'Images/Download28x28px.png')}" /> </td>
                </tr>
            </table>
            <apex:pageBlockTable value="{!OpenSalesOrders}" var="so"  styleClass="dataTable">
                <apex:column headerValue="Order #" value="{!so.OrderNo}"/>
                <apex:column headerValue="Document Date">
                    <apex:outputText value="{0,date,MM/dd/yyyy}">
                        <apex:param value="{!so.DocumentDate}" />
                    </apex:outputText>
                </apex:column>

                <apex:column headerValue="Purchase Order #" style="width:10%;" value="{!so.PurchaseOrderNo}"/>
                <apex:column headerValue="Sales Org" style="width:10%;" value="{!so.SalesOrg}"/>
                <apex:column headerValue="Amount" style="text-align:right;width:10%;">
                    <apex:outputText value="{0,number,currency}">
                        <apex:param value="{!so.Amount}" />
                    </apex:outputText>
                </apex:column>
                <apex:column headerValue="Currency" style="text-align:center;" value="{!so.Curren}"/> -->
                <apex:column headerValue="Products" style="width:30%;" value="{!so.Product}"/>
                <apex:column headerValue="SO Status" style="width:10%;" value="{!so.SOStatus}"/>
            </apex:pageBlockTable>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.js')}"></script>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.dataTables.js')}"></script>
            <script type="text/javascript" language="javascript">
            var j$ = jQuery.noConflict();
            j$('table.dataTable').dataTable({
                sPaginationType: "full_numbers"
            });
            </script>  

        </apex:pageBlock>

        <apex:pageBlock title="Open Deliveries" rendered="{!displayOpenDeliveries}">
            <table width="100%">
                <tr>
                    <td width="12%"><b>Number of Deliveries:</b></td>
                    <td width="15%" align="left">{!DelNumOf}</td>     
                    <td style="width:55%; text-align:right; padding-right: 7px"><apex:commandButton action="{!GenerateCSV}" title="Download CSV" id="btnOpenSalesCSV" value="Download" image="{!URLFOR($Resource.UtilityImages, 'Images/Download28x28px.png')}" /> </td>
                </tr>
            </table>
            <apex:pageBlockTable value="{!OpenDeliveries}" var="del"  styleClass="dataTable">
                <apex:column headerValue="Sales Order #" style="width:10%;"  value="{!del.RefSalesOrder}"/>
                <apex:column headerValue="Delivery Number" style="width:10%;"  value="{!del.DeliveryNumber}"/>
                <apex:column headerValue="Ship to Party" value="{!del.ShipToParty}"/>
                <apex:column headerValue="Ship to Party Name" value="{!del.ShipToPartyName}"/>
                <apex:column headerValue="Delivery Date" >
                    <apex:outputText value="{0,date,MM/dd/yyyy}">
                        <apex:param value="{!del.DeliveryDate}" />
                    </apex:outputText>
                </apex:column>

                <apex:column headerValue="Planned GI Date" >
                    <apex:outputText value="{0,date,MM/dd/yyyy}">
                        <apex:param value="{!del.GIDate}" />
                    </apex:outputText>
                </apex:column>

                <apex:column headerValue="Products" style="width:30%;" value="{!del.Product}"/>
            </apex:pageBlockTable>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.js')}"></script>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.dataTables.js')}"></script>
            <script type="text/javascript" language="javascript">
            var j$ = jQuery.noConflict();
            j$('table.dataTable').dataTable({
                sPaginationType: "full_numbers"
            });
            </script>  

        </apex:pageBlock>

        <apex:pageBlock title="Open Invoices" rendered="{!displayOpenInvoices}" >
            <table width="100%">
                <tr>
                    <td width="15%"><b>Number of Open Invoices:</b></td>
                    <td width="5%" align="left">{!InvNumOf}</td>     
                    <td width="8%"><b>Total Amount:</b></td>
                    <td width="15%" align="left">
                        <apex:outputText value="{0,number,currency}">
                            <apex:param value="{!InvTotalAmount}" />
                        </apex:outputText>
                    </td> 
                    <td style="color:red; font-size:1.0em;">{!TooManyRecords}</td>
                    <td style="width:15%; text-align:right; padding-right: 7px"><apex:commandButton action="{!GenerateCSV}" title="Download CSV" id="btnOpenSalesCSV" value="Download" image="{!URLFOR($Resource.UtilityImages, 'Images/Download28x28px.png')}" /> </td>
                </tr>
            </table>
            <apex:pageBlockTable value="{!OpenInvoices}" var="inv" styleClass="dataTable">
                <apex:column headerValue="Invoice Number" value="{!inv.InvoiceNumber}"/>
                <apex:column headerValue="Invoice Date" >
                    <apex:outputText value="{0,date,MM/dd/yyyy}">
                        <apex:param value="{!inv.InvoiceDate}" />
                    </apex:outputText>
                </apex:column>

                <apex:column headerValue="Payer" value="{!inv.Payer}"/>
                <apex:column headerValue="Payer Name" value="{!inv.PayerName}"/>
                <apex:column headerValue="Amount" style="text-align:right;">
                    <apex:outputText value="{0,number,currency}">
                        <apex:param value="{!inv.Amount}" />
                    </apex:outputText>
                </apex:column>
                <apex:column headerValue="Currency" value="{!inv.Curren}"/>     
                <apex:column headerValue="Payment Due Date" >
                    <apex:outputText value="{0,date,MM/dd/yyyy}">
                        <apex:param value="{!inv.PaymentDueDate}" />
                    </apex:outputText>
                </apex:column>
                <apex:column headerValue="Overdue Days" value="{!inv.NoDueDays}" />

            </apex:pageBlockTable>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.js')}"></script>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.dataTables.js')}"></script>
            <script type="text/javascript" language="javascript">
            var j$ = jQuery.noConflict();
            j$('table.dataTable').dataTable({
                sPaginationType: "full_numbers"
            });
            </script>  

        </apex:pageBlock>

        <apex:pageBlock title="Account Receivable Notes" rendered="{!displayARText}">
            <apex:pageBlockTable value="{!ARText}" var="art" styleClass="dataTable">
                <apex:column >
                    <apex:outputText value="{!art}" escape="false" />
                </apex:column>
            </apex:pageBlockTable>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.js')}"></script>
            <script type="text/javascript" language="javascript" src="{!URLFOR($Resource.jQueryDataTablesZip, 'js/jquery.dataTables.js')}"></script>
            <script type="text/javascript" language="javascript">
            var j$ = jQuery.noConflict();
            j$('table.dataTable').dataTable({
                sPaginationType: "full_numbers",
                "aoColumns": [
                      { "bSortable": false }
                    ],
                "aaSorting": [] 
            });
            </script>  

        </apex:pageBlock>
    </div>

    </apex:form> 
    </body>
</apex:page>

Inline VF Page 2

<apex:page standardController="Account" extensions="CustomerCreditInfoController" standardStylesheets="true" showHeader="false" sidebar="false">
<link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/zen-componentsCompatible.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/elements.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/common.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/rlHovers.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/chatterCore.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/chatterExtended.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/SocialCrm.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/SocialKeyCRM.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1400172052000/Theme3/base/dStandard.css" rel="stylesheet" type="text/css"/><link href="/sCSS/30.0/sprites/1401314678000/Theme3/default/base/extended.css" rel="stylesheet" type="text/css"/>
<c:LoadingBox />
<body>
<!-- <c:PageLoadingAnimation /> -->
        <apex:pageMessages />       
            <apex:form id="cciForm">
                <div id="ccicontainer" style="float:left;width:75%">
                    <apex:commandButton action="{!ViewCustomerCreditInfo}" value="Get SAP Data" id="btnCCI" status="loadStatus" rerender="cciForm"/>
                </div>

            <div style="width:100%">
                <apex:pageBlock rendered="{!displayCustomerCreditInfo}">
                    <apex:pageBlockSection columns="2">

                        <apex:outputText label="Credit Block" value="{!If(cci.creditblock=='','No','Yes') }" id="creditblock"/>          
                        <!-- <apex:outputText label="Risk Category" value="{!cci.RiskCategory}" id="riskcategory"/> -->
                        <apex:outputText label="Rating" value="{!cci.Rating}" id="rating"/>
                        <apex:outputText label="Risk Category" value="{!cci.RiskClass}" id="riskclass"/>

                        <apex:outputText label="Credit Limit" id="creditlimit" value="{0,number,currency}">  
                            <apex:param value="{!cci.CreditLimit}" />  
                        </apex:outputText>              

                        <apex:outputText label="Credit Limit Used" value="{!cci.CreditLimitUsed}" id="creditlimitused"/>
                        <!--<apex:outputText label="Country Key" value="{!cci.CountryKey}" id="countrykey"/>-->
                        <!--<apex:outputText label="Name" value="{!cci.name1}" id="name"/>-->

                        <apex:outputText label="Credit Exposure" id="creditexposure" value="{0,number,currency}">  
                            <apex:param value="{!cci.CreditExposure}" />  
                        </apex:outputText>              

                       <!--<apex:outputText label="City" value="{!cci.City}" id="city"/>-->
                        <!--<apex:outputText label="Region" value="{!cci.Region}" id="region"/> -->
                        <apex:outputText label="Currency Key" value="{!cci.CurrencyKey}" id="currencykey"/>

                    </apex:pageBlockSection>

                    <table width="50%">
                        <tr><td>
                        <table class="list" cellspacing="0" cellpadding="0" border="0">
                            <tr class="headerRow">
                                <th class=" zen-deemphasize">Aging Periods</th>
                                <th class=" zen-deemphasize">Invoice Count</th>
                                <th class="CurrencyElement zen-deemphasize" scope="col">Amount</th>
                            </tr>

                            <tr class="dataRow even first">
                                <td>0 to 30 Days</td>
                                <td class=" dataCell  ">{!cci.InvLessThan30}</td>
                                <td class=" dataCell  CurrencyElement">
                                    <apex:outputText value="{0,number,currency}">  
                                        <apex:param value="{!cci.AmtLessThan30}" />  
                                    </apex:outputText>              
                                </td>
                            </tr>

                            <tr class="dataRow even">
                                <td>31 to 60 Days</td>
                                <td class=" dataCell  ">{!cci.Inv31To60}</td>
                                <td class=" dataCell  CurrencyElement">
                                    <apex:outputText value="{0,number,currency}">  
                                        <apex:param value="{!cci.Amt31To60}" />  
                                    </apex:outputText>              
                                </td>
                            </tr>

                            <tr class="dataRow odd">
                                <td>61 to 90 Days</td>
                                <td class=" dataCell  ">{!cci.Inv61To90}</td>
                                <td class=" dataCell  CurrencyElement">
                                    <apex:outputText value="{0,number,currency}">  
                                        <apex:param value="{!cci.Amt61To90}" />  
                                    </apex:outputText>              
                                </td>
                            </tr>

                            <tr class="dataRow even">
                                <td>91 to 120 Days</td>
                                <td class=" dataCell  ">{!cci.Inv91To120}</td>
                                <td class=" dataCell  CurrencyElement">
                                    <apex:outputText value="{0,number,currency}">  
                                        <apex:param value="{!cci.Amt91To120}" />  
                                    </apex:outputText>              
                                </td>
                            </tr>

                            <tr class="dataRow odd last">
                                <td>More than 120 Days</td>
                                <td class=" dataCell  ">{!cci.InvGreaterThan121}</td>
                                <td class=" dataCell  CurrencyElement">
                                    <apex:outputText value="{0,number,currency}">  
                                        <apex:param value="{!cci.AmtGreaterThan121}" />  
                                    </apex:outputText>              
                                </td>
                            </tr>

                        </table>
                        </td>
                        </tr>
                    </table>
            </apex:pageBlock>
        </div>
    </apex:form>
    </body>
</apex:page>
  • There is a good chance that these visualforce pages are the culprit, but without looking at them it is difficult to answer this question. Have you looked into what those pages are doing, external JS libraries on them? I've found that some of the new analytics/charting controls in VF can misbehave like this. Can you share an annotated version of these inline pages? – pchittum Aug 29 '14 at 19:53
  • Peter, is the getter methods in the controller can trigger the page refresh problem wile the page loads? – Bforce Aug 29 '14 at 20:06
  • @BaskaranS A simple test would be to remove the 2 inline pages in your sandbox that was recently refreshed which is closer to PRD, and see if the page refresh happens. I also suspect sidebar JS refreshing the page, so the above test would give direction on where the issue is rooting from. – Rao Aug 29 '14 at 21:25
  • Thanks @rao. I have removed the inline pages and now it is working fine. I'm wondering how the stuff inside the iframe affected the parent page. Would the getter methods in the inline page controller be the reason? Please advice. – Bforce Aug 30 '14 at 3:26
  • @rao if you want i can add the controller code also. pls advice. – Bforce Aug 30 '14 at 17:02
1

Without extra support from the outside the embedded visualforce pages should not be able to refresh anything outside their iframe-jail.

First I would recommend that you use a tool like firebug to monitor what is happening. There is a network tab which shows you all the requests and even ajax activity.

Second you should as rao suggested test-deactivate the two pages. Also have a look at custom JavaScript buttons and links. They can inject js which is powerful enough to theoretically make the toplevel reloads. Also custom buttons at related list can do that.

Then of course also check the sidebar.

Just to clarify: those buttons and links could invoke scripts without being pressed. Look especially for {!REQUIRESCRIPT

If you have located the responsible component(s) you need to dig deeper inside of them to nail down the actual line which does it.

| improve this answer | |

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.