You need to sign in to do that
Don't have an account?
Gokul Pillai 1
SOQL for fetching contact roles and fields from Contacts through opportunity
I have a requirement wherein I have to create batch class that picks all the contacts which has “Eligible” checkbox true. Batch execution should perform below operation :
•All the opportunities which has these contacts as a Ship To contact roles , update its stage as “Qualified”.
but I am unable to fetch the contact roles from the opportunity
•All the opportunities which has these contacts as a Ship To contact roles , update its stage as “Qualified”.
but I am unable to fetch the contact roles from the opportunity
Select (Select OpportunityId From OpportunityContactRoles) From Opportunity where id in (Select OpportunityId From OpportunityContactRole where ContactId != '')
I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.
Thanks.
All Answers
you can use below SOQL to get contact roles from the opportunity.
If this solution is usefull for you, Please mark as a Best Answer to help others.
Regards
Mukesh
Select (Select OpportunityId From OpportunityContactRoles) From Opportunity where id in (Select OpportunityId From OpportunityContactRole where ContactId != '')
I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.
Thanks.
Final Query was: