I am trying to build a FetchXML query that does the same as the following SQL query. Basically, output the opportunity names and the linked appointments' subjects if custom attribute "dev_ownercommunityid" on the appointment equals to the opportunity's ownerid attribute.
select top 10 o.[name], apt.[subject]
from Opportunity o with (nolock)
left join Appointment apt with (nolock)
on o.opportunityid = apt.regardingobjectid
where apt.dev_ownercommunityid = o.ownerid
/* dev_ownercommunityid is a custom attribute we added to appointment entity */
I can do the outer join easily but I can't figure out how to do the "where" part.
Please kindly help. I am using Dynamics CRM 2013.