• Ryan Young
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Sales Operations
  • United One Resources


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi All,

I am new at this, so please bare with me. I am trying to create a custom Export to Excel button that would appear on our Account related list "Agency Planning". I am receiving the syntax error: "Error: Export_to_Excel line 4, column 71: Element type "apex:pageblocktable" must be followed by either attribute specifications, ">" or "/>"

I ended line 4 with ">" but the error is still appearing. Any help would be great!

<apex:page standardController="Account" contentType="application/vnd.ms-excel">
    <apex:relatedList="Agency_Planning__c">
        <apex:pageBlock title="Agency Planning">
            <apex:pageBlockTable value="{!Account.Agency_Planning__c}"var="Agency_Planning__c">
                <apex:column value="{!Agency_Planning__c.Accounting_Month}">
                <apex:column value="{!Agency_Planning__c.Planned_New_Business_Commission}"/>
                <apex:column value="{!Agency_Planning__c.Actual_New_Business_Commission}"/>
                <apex:column value="{!Agency_Planning__c.Over_Under}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>   
    </apex:relatedList>                          
</apex:page>


Thanks!
Erica

Hi, 

I have trigger that rolls up total number of contacts on Account, This trigger was working fine in sandbox, But when moved to production it is throwing errors at the backend  saying 'System.LimitException: Too many code statements: 200001'. My company production enviroment is integrated with 3rd party system. So everytime there is an update from external system this trigger is firing errors.

 

Below is my code:

 

trigger ContactRollUpOnAccounts on Contact (after delete, after insert, after update) {
        
  
  set<ID> AccountIds = new set<ID>();
  set<ID> conIDs = new Set<ID>();
 
  
  if(trigger.isInsert || trigger.isUpdate){
    for(Contact c : trigger.new){
      AccountIds.add(c.AccountId);
    }
  }
 
  
  if(trigger.isDelete){
    for(Contact c : trigger.old){
      AccountIds.add(c.AccountId);
    }
  }
 
 
   Map<ID, Contact> AccountMap = new Map<ID, Contact>([select id,AccountId
    from Contact where AccountId IN :AccountIds]);
 
  List<Account> AccountsToUpdate = new  List<Account>();
 
 
  for(Account a : [Select Id, Contacts__c from Account where Id IN :AccountIds ]){
        
      for (Contact con : AccountMap.values()) {
            if (con.AccountId == a.Id)
                conIDs.add(con.Id);
        }   
       if (a.Contacts__c!= conIDs.size())
            a.Contacts__c= conIDs.size();
              AccountsToUpdate.add(a);
    } 
 
  update AccountsToUpdate;
 }

 

 I understand the problem is because I am writing for loop within a for loop, but I am not aware of the workaround to avoid this.

 

Please help me with your valuiable thoughts