• Teju Meshram
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Can you please provide me code for this
Here is my code, but I am getting an error

trigger AccountTrigger on Account (before update) {
    if(Trigger.isBefore && Trigger.isUpdate){
        AccountTriggerHandler.updateAcct(Trigger.new, Trigger.oldMap);
    }

}

public class AccountTriggerHandler {
    public static void updateAcct(List<Account> acctList, Map<Id, Account> actMap){
        
        Set<Id> actId = new Set<Id>();
        
        for(Account a : acctList){
            if((a.rating != actMap.get(a.id).rating && a.rating == 'Warm')&& (a.Type != actMap.get(a.id).Type && a.Type == 'Prospect')){
                 actId.add(a.Id);             
            }
        }
           
        Map<Id, Contact> conMap = new Map<Id, Contact>();
        for(Contact con :[SELECT id, firstName from Contact where accountId IN : actId]){
            
                conMap.put(con.id, con);
        }

        for(Account act : [SELECT id, description from Account where Id IN : actId]){
            act.Description = conMap.get(act.id).firstname;
            
        }        
        
    }

}
Can you please provide me code for this
Here is my code, but I am getting an error

trigger AccountTrigger on Account (before update) {
    if(Trigger.isBefore && Trigger.isUpdate){
        AccountTriggerHandler.updateAcct(Trigger.new, Trigger.oldMap);
    }

}

public class AccountTriggerHandler {
    public static void updateAcct(List<Account> acctList, Map<Id, Account> actMap){
        
        Set<Id> actId = new Set<Id>();
        
        for(Account a : acctList){
            if((a.rating != actMap.get(a.id).rating && a.rating == 'Warm')&& (a.Type != actMap.get(a.id).Type && a.Type == 'Prospect')){
                 actId.add(a.Id);             
            }
        }
           
        Map<Id, Contact> conMap = new Map<Id, Contact>();
        for(Contact con :[SELECT id, firstName from Contact where accountId IN : actId]){
            
                conMap.put(con.id, con);
        }

        for(Account act : [SELECT id, description from Account where Id IN : actId]){
            act.Description = conMap.get(act.id).firstname;
            
        }        
        
    }

}
I am fetching Standard Report in Apex class using Page reference and sending email to users having Report as excel in attachment . 
I am getting the Report in standard format . But is there any way to exclude the header and footer from the report . Please check the attached file for reference. How can I exclude row 1-14 and Grand Total records from Report.User-added imageUser-added image