Answered by:
CRM 4.0 Distribute Campaign Activity programmaticlly

Question
-
Hello everybody,
I’m trying to perform a distribution of the campaign activities programmatically, inside a custom workflow activity, using the sdk objects DistributeCampaignActivityRequest/DistributeCampaignActivityResponse:
The code I am using is the following:
Moniker ownerMoniker = new Moniker(); ownerMoniker.Id = context.UserId; ownerMoniker.Name = EntityName.systemuser.ToString(); // Create the request object. DistributeCampaignActivityRequest request = new DistributeCampaignActivityRequest(); // Set the properties of the request object. phonecall p = new phonecall(); p.subject = "test"; request.Activity = p; request.CampaignActivityId = context.PrimaryEntityId; request.OwnershipOptions = PropagationOwnershipOptions.Caller; request.Owner = ownerMoniker; request.Propagate = true; // Execute the request. DistributeCampaignActivityResponse response = (DistributeCampaignActivityResponse)crmService.Execute(request);
I’ve tried also to use the direct assignment request.Activity = new phonecall();
The error code I get is 0x80131500 for each activity the procedure has tried to distribute, under Failure section.
The error it is not listed in the SDK error list.
Debugging the code, everything seems to be ok before the Execute method. Also the system job i succedeed.
Do you have any suggestion/correction about this ?
Many thanks in advance for answering.
Thursday, June 9, 2011 10:27 AM
Answers
-
Hi
Update Rollup 17 fixes this issue.
refer here : http://community.spiceworks.com/topic/141795-microsoft-dynamics-crm-4-0-distribute-campaign-activity-not-working
vishal swami
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"
http://msdynamics4you.blogspot.com- Proposed as answer by VishalSwamiMicrosoft employee Tuesday, June 14, 2011 6:21 AM
- Marked as answer by Oltion Sunday, June 19, 2011 10:48 AM
Tuesday, June 14, 2011 6:21 AM -
Thanks VishalSwani, probably you're right. Currently I have Rollup 14.
Anyway I fixed the problem following the retrievemembersbulkoperation.cs (I found this class in SDK \server\reference\cs\bulkoperation). It work perfectlly now.
Best,
- Marked as answer by Oltion Sunday, June 19, 2011 10:48 AM
Sunday, June 19, 2011 10:47 AM
All replies
-
hi
is it happening for phone call only or for all activities? Because once I experienced the same issue for email activity and that was related to the 'null' as tracking token. installing rollup did the trick, what rollup you are on ?
vishal swami
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"
http://msdynamics4you.blogspot.comTuesday, June 14, 2011 5:50 AM -
Hi
Update Rollup 17 fixes this issue.
refer here : http://community.spiceworks.com/topic/141795-microsoft-dynamics-crm-4-0-distribute-campaign-activity-not-working
vishal swami
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"
http://msdynamics4you.blogspot.com- Proposed as answer by VishalSwamiMicrosoft employee Tuesday, June 14, 2011 6:21 AM
- Marked as answer by Oltion Sunday, June 19, 2011 10:48 AM
Tuesday, June 14, 2011 6:21 AM -
Thanks VishalSwani, probably you're right. Currently I have Rollup 14.
Anyway I fixed the problem following the retrievemembersbulkoperation.cs (I found this class in SDK \server\reference\cs\bulkoperation). It work perfectlly now.
Best,
- Marked as answer by Oltion Sunday, June 19, 2011 10:48 AM
Sunday, June 19, 2011 10:47 AM