Some background: I'm writing a custom workflow activity for CRM 2011 in C# and I am using early bound classes generated by CrmSvcUtil.exe. My plugin takes an opportunity as its only input and is supposed to check its related activities, then set a field on the opportunity to denote whether the opportunity needs more follow-up. My problem currently is that whenever I attempt to retrieve the related activities, the result is null
. Here's the relevant part of my code:Opportunity currentOpportunity = (Opportunity) service.Retrieve(context.PrimaryEntityName, context.PrimaryEntityId, new ColumnSet(true));
currentOpportunity.Opportunity_ActivityPointers
I was under the impression that since there is a one-to-many relationship between Opportunity and Activity that this would grab all the relevant activities, but it doesn't seem to be doing that.
I'm still new to CRM and C#, so any insight as to what I'm doing wrong is appreciated!