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?
Hi Pocia,
Group OR cannot be used between entities, only between fields, so we have to create two custom fields and use them to represent the results of the two entities.
New two Whole Number fields on the User entity, set them as Rollup fileds
When these two Rollup fields are created, they will wait for 12 hours and then automatically calculate the latest results every hour.
Then in the Advanced Settings, set the filter as follow, use Group OR to connect both Rollup fields.
The Rollup field is summarized once every hour, so when you query, the result may not be the latest. We can use Flow to replace the function of Rollup.
Flow can update the latest summary results in real time
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
87