• Adrianne Martinson 5
  • NEWBIE
  • 0 Points
  • Member since 2016

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

I need to have a trigger to copy the value of a picklist from Account to its related Contacts (another custom picklist).
The requirement is only to be copied if in the Contact poage the picklist is empty.

I tried this trigger:
 
trigger UpdateContactRegione on Contact(before Insert, before Update) {

    for(Contact Cont: Trigger.new){

     Account acct = [select id,Regione__c from Account where Id=:Cont.AccountId];

       if(Cont.Regione__c == null)

                     
          Cont.Regione__c= acct.Regione__c;

     
       }

   }

But it worksonly if I change the picklist in Contact and not viceversa.

Any suggestions?

Thanks,
Skender