+ Start a Discussion

Opportunity trigger to update sales team based on partner



I'm new to Apex code and wondered if someone could help me with the following scenario:


- We have sales guys who work globally on opportunities involving partners. It's hard for us to define security setting for these individuals without giving them access to all our data.


- We need to automatically update the opportunity sales team based on the partner chosen within the related list that is selected in the opportunity.

I have a list of which sales guys look after each partner opps so I assume this would need to be related to the account id for the partner orgs.


As I say I'm new to Apex, so am unsure if this is achievable?


Many thanks.


This should be do-able. 


One possible solution would be to create a trigger on your opportunity that fires when an opportunity is inserted or updated.  That trigger would check to see which partner was selected and update the opportunity sales team based on that.


Does this help?  


Thanks for the response.


Great news that it's doable. What is a good starting point for writing this (my first trigger)?