+ Start a Discussion
Kenn K.Kenn K. 

Query Opportunity.ownerId from Quotes in a trigger

Hi There,


I would like to query for the opportunity.ownerId of the opportunity from a quote using a trigger. (I.e. who is the owner of the opportunity tied to the current quote) How do I go about doing this in a trigger?

Can't seem to get anywhere. Please explain what you did a little.


Thanks a lot!


is this what you're looking for?


Id oppOwnerId = [Select Opportunity__r.OwnerId, Opportunity__c From Quote__c ].Opportunity__r.OwnerId;

Kenn K.Kenn K.

Thanks for the quick response.


Not really sure if you can implement it like that in a trigger. I thought it had to do with querying opportunityId, putting that in a set then create a map to map quote to opportunity. Does it make sense?