You need to sign in to do that
Don't have an account?
tomasdd
Trigger for checking if user exist in Opportunity Team
Hi All,
Please help - I have to build a trigger which will check if I want to add user A and this user is existing in Opportunity Team already show error "User already exist in Opportunity Team ! Add another user".
Thank you for help
This is just a way I could think but I think what you could do is to get all the opportunity teams that the user belongs and in case if the user is present in the opportunity team then you could throw an error.
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Hi Anutej,
This is good idea but if you have a 2 opportunities "OppA" and "OppB" and user exist only in opportunity team for opportunity "OppA" then you will be able to add the same user for opportunity team for "OppB" but for "OppA" not.
This is why I need a trigger to check if user is exist on opportunity team for current opportunity.
Hope I was able to address in case if there is any difference in understanding please let me know.
Not exactly,
Let's imagine that you have 2 opportunities A and B for example. These opportunites have opportunity teams. Now you can add User ABC to opp team in opportunity A and B. You added this user to opp team for opportunity A.
But when another user would like to add the same user ABC to opportunity team for opportunity A he should see the error "Hey, the user is already exist".
This is just an idea but would it be possible to have a field that could hold all the opportunity teams a user belongs to and in case if a user is trying to add a particular user to an opportunity team you can check with the values in that custom field and in case if he is already present you could certainly throw an error.