locked
CRM 4.0 Distribute Campaign Activity programmaticlly RRS feed

  • 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

All replies