I am trying to get all the activities related to an opportunity record in Dynamics CRM 2013.
I've tried using the RollupRequest, but I am getting an error that the activitypointer is not a supported rollup entity. But if I try the same code using an account instead of an opportunity CRM does not complaint.
I want to avoid using multiple queries to retrieve the activities in order to use the paging feature of query set or fetchxml.
Below is the testing code I used. According to Microsoft the combination is not one of the supported ones: http://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.rolluprequest.aspx
// Create QueryExpression
var query = new QueryExpression() {
EntityName = "activitypointer",
ColumnSet = new ColumnSet(true)
};
// Create RollupRequest
RollupRequest rollupRequest = new RollupRequest();
rollupRequest.Query = query;
rollupRequest.Target = new EntityReference("opportunity", new Guid("1d317b15-dbe0-e311-b505-0050569d9a3e"));
rollupRequest.RollupType = RollupType.Extended;
Console.WriteLine("Created RollupRequest.");
// Execute RollupRequest
RollupResponse rollupResponse = (RollupResponse)_serviceProxy.Execute(rollupRequest);
Console.WriteLine("Executed RollupRequest.");