+ Start a Discussion
Sidharth Panda 5Sidharth Panda 5 

Notes&Attachment related list on Account not working properly in a Visualforce Page.

We referenced <apex:relatedlist list="CombinedAttachments" title="{!$Label.Notes_Attachments}"/> on Visualforce Page. But the problem with this retated list is, when we click on attach file in it : A new window opens and there are option to upload and attach file and finally to click on 'Done'. When I click on Done, Visualforce Page becomes unresponsive and no attachment is added. Do anyone have workaround regarding this?
Ankur Saini 9Ankur Saini 9
Hi Sidharth 

Could you please show me your code ?

Thanks 
Ankur Saini
Sidharth Panda 5Sidharth Panda 5
<apex:page standardcontroller="Account" extensions="Player_PersonAccountDetailPageController,AccountHistoryExtension,BOnAuthenticateUserAPICallout" id="Playerpage">
<apex:includeScript value="/support/console/22.0/integration.js"/>
<apex:includeScript value="/soap/ajax/35.0/connection.js"/>
<apex:includeScript value="/soap/ajax/35.0/apex.js"/>
<apex:stylesheet value="{!$Resource.player_DetailPagecssFile}"/>
<script  type="text/javascript">
 window.onload=  function() {    
    var isRetail = '{!retailAccount}';   
    window.focus();
    var retailPageURL = "/{!personAcc.Id}"+"?nooverride=1";
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {
               if(isRetail != 'false'){
                  sforce.one.navigateToURL(retailPageURL);

                  var navigated=false;     
                  var test=setInterval(function(){
                      //  alert(document.hidden);
                      if(document.hasFocus() && navigated)
                   {
                         sforce.one.navigateToURL("/001/o");
                            clearInterval(test);
                    }
         
                         navigated=true;
                     },1700);
     
                }
            
            
        }
        else{       
            if(isRetail != 'false'){
                  window.location.href = '/'+'{!personAcc.Id}'+'?nooverride=1';
            }     
        }
        if(sforce.console.isInConsole() && isRetail != 'true'){
            srcUp('/apex/Player_PersonAccountDetailPage?id='+'{!personAcc.Id}'+'&sfdc.override=1');
            
            sforce.console.getEnclosingPrimaryTabId(refreshPrimaryTab);
            var refreshPrimaryTab = function showTabId(result) {
            var tabId = result.id;
            sforce.console.refreshPrimaryTabById(tabId, true);
            };

        }   
}
</script>
<script type="text/javascript">
        var Bonurl;
        function openTab(BOnURL) {
            Bonurl = BOnURL;
            if (Bonurl != ''){
                if(!sforce.console.isInConsole()){
                    window.open(Bonurl,'_blank','height=400,width=400');
                }
                else { srcUp(Bonurl);}
            }
        }
</script>
  <apex:pageMessages id="showmsg"></apex:pageMessages>
    <apex:sectionheader title="{!$ObjectType.Account.label} {!$Label.Detail}" subtitle="{!personAcc.Name}"/>
    <chatter:feedwithfollowers entityId="{!personAcc.Id}"/><br/>
    <div id="wrapper" class="inline">
            <a href="#Caseslist" name="ab">{!$Label.Cases}</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            <div class="text">
            <apex:relatedList list="Cases" title="{!$Label.Cases}"/>
            </div>
    </div>
    <div id="wrapper" class="inline">
            <a href="#BankAccountslist">{!$Label.Bank_Accounts}</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            <div class="textBA">
            <apex:relatedlist list="Bank_Accounts__r" title="{!$Label.Bank_Accounts}"/>
            </div>
    </div>
    <div id="wrapper" class="inline">
            <a href="#OpenActivitieslist">{!$Label.Open_Activities}</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            <div class="textOA">
            <apex:relatedlist list="OpenActivities" title="{!$Label.Open_Activities}" />
            </div>
    </div>
    <div id="wrapper" class="inline">
            <a href="#ActivityHistorieslist">{!$Label.Activity_History}</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            <div class="textAH">
            <apex:relatedlist list="ActivityHistories" title="{!$Label.Activity_History}" />
            </div>
    </div>
    <div id="wrapper" class="inline">
            <a href="#CombinedAttachmentslist">{!$Label.Notes_Attachments}</a>
            <div class="textCA">
            <apex:relatedlist list="CombinedAttachments" title="{!$Label.Notes_Attachments}"/>
            </div>
    </div>
  
 -
 -
 -  
 -
 - 
 -
 -   
    <!-- **********   [Related Lists for Record Type : Consumer ]   **********  -->
    <apex:outputPanel id="relatedLists" >
    <!-- <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!terminationReason}"/> -->
        <a id="Email Activities"/>
        
       <apex:relatedList list="silverpop__Silverpop_Email_Activities__r" title="{!$Label.Email_Activities}" rendered="{!!retailAccount}" />
        <apex:relatedList list="Cases" title="{!$Label.Cases}"/>
        <a id="BankAccountslist"/>
        <apex:relatedlist list="Bank_Accounts__r" title="{!$Label.Bank_Accounts}"/>
        <!--<apex:relatedlist list="Transact_Portal_Event__r" title="Transact Portal Event"/> -->
        <a id="OpenActivitieslist"/>
        <apex:relatedlist list="OpenActivities" title="{!$Label.Open_Activities}" id="activityList"/>
        <a id="ActivityHistorieslist"/>
        <apex:relatedlist list="ActivityHistories" title="{!$Label.Activity_History}" id="historyList"/>
       <!-- <a id="AccountHistoryList"/>
        <apex:relatedlist list="AccountHistory" title="{!$Label.Account_History}" id="accountHistoryList"/> -->
        <a id="CombinedAttachmentslist"/>
        <apex:relatedlist list="CombinedAttachments" title="{!$Label.Notes_Attachments}"/>
            
  </apex:outputpanel>
   
        <apex:form >   
       
        <apex:pageblock mode="maindetail">
        <apex:pageblocksection title="{!$Label.Account_History}" showheader="true" collapsible="true" columns="1"> 
   
        <apex:pageblockTable value="{!accountHistroy}" var="acctHistory" id="myPanel" align="center">
          <apex:column value="{!acctHistory.createddate}"/>
          <apex:column value="{!acctHistory.field}"/>
          <apex:column value="{!acctHistory.CreatedById}"/> 
          <apex:column value="{!acctHistory.oldvalue}"/>
          <apex:column value="{!acctHistory.newvalue}"/>
          <apex:facet name="footer">Showing Page # {!pageNumber} of {!totalPages}</apex:facet>
        </apex:pageblockTable> 
       </apex:pageblocksection> 

        <apex:outputPanel id="myButtons">       
           <apex:commandLink action="{!Beginning}" title="Beginning" value="{!$Label.First}" rendered="{!disablePrevious}" reRender="myPanel,myButtons" />|
           <apex:commandLink action="{!Previous}" title="Previous" value="{!$Label.Previous}" rendered="{!disablePrevious}" reRender="myPanel,myButtons"/>|       
           <apex:commandLink action="{!Next}" title="Next" value="{!$Label.Next}" rendered="{!disableNext}" reRender="myPanel,myButtons"/>|
           <apex:commandLink action="{!End}" title="End" value="{!$Label.Last}" rendered="{!disableNext}" reRender="myPanel,myButtons"/>  
        </apex:outputPanel>      
       

        </apex:pageblock>
         </apex:form>
        

</apex:page>