Skip to main content
All,

I am here seeking help for Apex Trigger coding. 

In the User Object I created a Custom Picklist field name Asset_Manager_Group__c with the values Group A, Group B, Group C, Group D

In Opportunities, I created another Custon Picklist field name Asset_Manager_Group__c with the values Group A, Group B, Group C, Group D

Apex Trigger Request - I am requesting if someone can help me create a trigger.  When an administrator selects a value in the Asset_Manager_Group__c in the User Object and saves the record, the same value will automatically populate in the Asset_Manager_Group__c field in the associated opportunity record based on Opportunity owner. For example if Asset_Manager_Group__c = Group A in Joh Doe User object, the related Opportunity records own by John Doe will have the same value in the Asset_Manager_Group__c field.

I really appreciate the help. Thank you.

 
7 answers
  1. Feb 5, 2015, 3:23 AM
    You don't actually need a trigger for this.  You can simply create a create a formula field on the opportunity object that will reference the field on the  user object.  See the path in this screenshot.  Because you're pulling the value of a picklist, the actual formula using the below example would be:

    TEXT(Owner:User.pjsdev__Manager_Group__c)

    You don't actually need a trigger for this. You can simply create a create a formula field on the opportunity object that will reference the field on the user object. See the path in this screenshot.
0/9000