• Hi There!
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Hey guys some background into my prob.  I need a lookup field, Account__c, to auto-populate with an account name on update of an event payment object.

 

The relavent schema looks like this:

 

Account

      Id

 

Opportunity

        AccountId

 

             opportunity child Event Payment

                                            Account__c

 So heres what I got so far:

 

trigger accountRename on Event_Payment__c (after update) {   

 Set<Id> accIDs = new Set<Id>();   

     for(Event_Payment__c a: Trigger.new){        accIDs.add(a.Id);    }            

 List<Account> accountList = [SELECT Id FROM Account WHERE Id in :accIDs];        

      for(Event_Payment__c a : Trigger.new){                     

                       for(Account i : accountList){         a.Account__c = i.Id;                        

       }                              update accountList;         }    }

 

Any ideas?


 

 

 

 

Hey guys some background into my prob.  I need a lookup field, Account__c, to auto-populate with an account name on update of an event payment object.

 

The relavent schema looks like this:

 

Account

      Id

 

Opportunity

        AccountId

 

             opportunity child Event Payment

                                            Account__c

 So heres what I got so far:

 

trigger accountRename on Event_Payment__c (after update) {   

 Set<Id> accIDs = new Set<Id>();   

     for(Event_Payment__c a: Trigger.new){        accIDs.add(a.Id);    }            

 List<Account> accountList = [SELECT Id FROM Account WHERE Id in :accIDs];        

      for(Event_Payment__c a : Trigger.new){                     

                       for(Account i : accountList){         a.Account__c = i.Id;                        

       }                              update accountList;         }    }

 

Any ideas?