• Marlon Agard 2
  • NEWBIE
  • 0 Points
  • Member since 2017

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

I am trying to update an account field based on a contact field. I have discovered I need a trigger.

here is my trigger but keep getting an error;

trigger ContactUpdate on Account (after update) {
    set<Id> accountaccList = new set<Id>();
    List<Contact> listContact = new List<Contact>();
    
    for(Account acct : trigger.new){
        if(acct.Account_Has_MQL__c){
            accountaccList.add(acct.id);
        }
    }
    listContact = [ SELECT lastname, AccountId FROM Contact WHERE AccountId IN :accountaccList];
    
    if ( listContact.size() > 0 ) {
        for ( Contact con : listContact ) {            
                con.Became_a_Marketo_Qualifying_Lead__c=true;
                
           }
         if(listContact.size()>0)   
           update listContact;
    }
}
Hi,

Some help need badly.

I have a custom button called 'Meeting Notes" and this then opens up a URL custom object of Meeting Notes. 

Once this has been saved, I need the record that is being saved to populate a field called 'Relate Meeting Notes' on the events page. How would i do this? Can i do this?

Thanks
Hi,

I am trying to update an account field based on a contact field. I have discovered I need a trigger.

here is my trigger but keep getting an error;

trigger ContactUpdate on Account (after update) {
    set<Id> accountaccList = new set<Id>();
    List<Contact> listContact = new List<Contact>();
    
    for(Account acct : trigger.new){
        if(acct.Account_Has_MQL__c){
            accountaccList.add(acct.id);
        }
    }
    listContact = [ SELECT lastname, AccountId FROM Contact WHERE AccountId IN :accountaccList];
    
    if ( listContact.size() > 0 ) {
        for ( Contact con : listContact ) {            
                con.Became_a_Marketo_Qualifying_Lead__c=true;
                
           }
         if(listContact.size()>0)   
           update listContact;
    }
}