+ Start a Discussion
Eric BlaxtonEric Blaxton 

When is the default Opportunity team added to the Opportunity

I am wanting to use a process / flow when a New Op is created:

1. looks up the current user's default opp team whose member role equals 'Primary SE'
2. populates a custom field on the op with that user

I can get most of it with my current process/flow, but there seems to be an issue.  The issue being that no matter who I login as, the name is being populated with my 'Primary SE'.  

1.  Do I need to be looking up the current user id or is the op id sufficient?
2. When is the default op team assigned to an op?  At creation or when the record is saved?

Best Answer chosen by Eric Blaxton
you have to checked..logged in user that's it.

id currentUser=userinfo.getUserId();

///Trigger Logic

trigger opptyTrigger on Opportunity(before insert){

for(Opportunity opp: Trigger.New){