Hello,
I want to create view which retrieves all activities which are assigned to two Salespeople, which have their two separate fields (lookup) on Account entity:
I'm able only to retrieve activites assigned to one of the representatives:
Here I'm going from 1:N relationship between Activity and User, and then, 1:N relationship between User and Account. This view correctly shows all activities assigned to all people that are Representative 1.
But pulling in the second field, it seems that it takes the inner result of all the clauses (so Activities for Users that are BOTH Representative 1 and 2, which is not a common case:
Here's the XML of the second query:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
<entity name="activitypointer" >
<attribute name="subject" />
<attribute name="activitytypecode" />
<order attribute="subject" descending="false" />
<link-entity name="systemuser" from="systemuserid" to="owninguser" alias="aa" >
<link-entity name="account" from="pr_representative1" to="systemuserid" alias="ab" />
<link-entity name="account" from="pr_representative2" to="systemuserid" alias="ac" />
</link-entity>
<attribute name="ownerid" />
<attribute name="createdon" />
<attribute name="activityid" />
</entity>
</fetch>
I'm not sure what I'm missing here... Is even this scenario achievable using FetchXML? Or do I need to lean towards the plugin or script? Or maybe something different?
My goal is to create a chart counting all of the activities for the both types of representative- maybe there's someting that can be done directly in chart structure?