You need to sign in to do that
Don't have an account?
Austin Gutz
Opportunity Trigger that pulls Opportunity Team Member's email address
I've found a few posts that kind of address this need but I can't seem to get any of them to work.
I feel like I'm kind of close with this post: https://developer.salesforce.com/forums/?id=906F00000005KqHIAU
I need to trigger an email send from a custom object related to an Opportunity. The email needs to go to the Opportunity Team member with the role of Program Manager. I've added a custom email field on the Opportunity called PM_Email__c and had hoped I could update this field with process builder or a workflow rule... turns out that's not an option. I'd use this field to populate another email field on my custom object but I need to first find a way to get the email in the Opportunity field. Any help?
I feel like I'm kind of close with this post: https://developer.salesforce.com/forums/?id=906F00000005KqHIAU
I need to trigger an email send from a custom object related to an Opportunity. The email needs to go to the Opportunity Team member with the role of Program Manager. I've added a custom email field on the Opportunity called PM_Email__c and had hoped I could update this field with process builder or a workflow rule... turns out that's not an option. I'd use this field to populate another email field on my custom object but I need to first find a way to get the email in the Opportunity field. Any help?
All Answers
From an Opportunity - When someone is added as an Opportunity Team Member and his or her role is Program Manager, I need the email address for that user to be put into a custom field (PM_Email__c_) on the Opportunity. In our ORG we will only ever have 1 Opportunity Team member with that role on a single Opportunity at one time.
Error: Compile Error: Incorrect SObject type: OpportunityTeamMember should be Opportunity at line -1 column -1
If I update the line to the Opportunity object then I get:
Error: Compile Error: Invalid loop variable type expected Opportunity was OpportunityTeamMember at line 7 column 5
This seems to be working perfectly. Thank you!
Any help on getting started with a test class for this trigger?