You need to sign in to do that
Don't have an account?
Forrest Muldune
Apex Trigger - Cross Object User and Opportunities
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.
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.
TEXT(Owner:User.pjsdev__Manager_Group__c)
All Answers
TEXT(Owner:User.pjsdev__Manager_Group__c)
AND(
ISCHANGED(OwnerId),
OR(Owner.Profile.Name = "Account Manager",
Owner.Alias = "fmuld",
ISPICKVAL(Owner.Asset_Manager_Group__c, 'Group B' )
)
Will this work?
I will test it to see if it works. I also added some Email Alerts and Field Updates to it. Thanks and I will send you some feedback.
thanks for the recommendation, it works!
Forrest