• Nandhini Govindraj
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
I have created a field :Total Annual Revenue .
Result should be like
Parent Ann revenue-5 total ann rev-12
Child Ann rev-2 total Ann Rev-7
Grant Child Ann rev-5 total Ann Rev-0
 
i have written code as below
 
trigger TotalAnnualRevenueChildAccount on Account (after insert,after update) {
  List<Account> ac=new List<Account>();
    Set<Id> accids=new Set<Id>();
             for(Account acc:trigger.new){
            accids.add(acc.Id);      

if(accids != null){
List<Account> acclist = [Select Id, AnnualRevenue from Account Where ID IN :accIds];
                                for(Account acc: acclist){                                               
                                                                acc. Total_AnnualRevenue__c+= acc.AnnualRevenue ;
                                                                ac.add(acc);                              
                                }
                }
                Update ac;
}


Can you help me in this
Thanks
Hi

I have created a field Total Annual Revenue .
Result should be lik
Parent Ann revenue-5 total ann rev-12
Child Ann rev-2 total Ann Rev-7
Grant Child Ann rev-5 total Ann Rev-0

For this i used this code
trigger TotalAnnualRevenueChildAccount on Account (after insert,after update) {
    Set<Id> accids=new Set<Id>();
      if(trigger.isinsert || trigger.isupdate && trigger.isafter){
         for(Account acc:trigger.new){
            accids.add(acc.Id);
         }
      Map<Id,Account> maccid=new  Map<Id,Account>();
      for(AggregateResult ar:[select Id,sum(AnnualRevenue)TotalAnnRev from Account where ParentId=:accids Group by Id]){
         Account ac=new Account();
         ac.Id=(Id)ar.get('Id');
         ac.Total_AnnualRevenue__c=(Double)ar.get('TotalAnnRev');
         maccid.put(ac.Id,ac);
         }
       update maccid.values();  
        } 
      }

I am not getting the result as i mention above..
Hi
I created vf page and changed the word doc of template to pdf.. 
Now I need to attach dat pdf for sending email to selected candidate.. How can i achieve this?? 
Hi
I have an offer letter template in word format. I have to send an email in pdf format using VF page on click of button to selected candidates after the approval process.
But the template which I have z generic. I need to change d name ,salary ,joining date, etc., of the candidate 
Help me how to do this scenario..