1

How do I programatically update the subject in an activepointerbase?

I'm getting a message that Create/Update method not allowed in Activity Pointer CRM 2011

I am getting an activitypointer record, and attempting to update it:

var activityPointer = xrmServiceContext.ActivityPointerSet.FirstOrDefault(x => x.Id == myGuid);

I then attempt to update it:

        activityPointer.EntityState = EntityState.Changed;
        organizationService.Update(activityPointer);

And I get an exception: Update method not allowed in Activity Pointer

enter image description here

There is a field called Subject in the ActivityPointerBase table.

Question: How do I programatically update the subject in an activepointerbase?

Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062

1 Answers1

2

You can't. Activity pointer is a special type of entity that holds together the common elements of the activity entities (task, email, fax, letter, phone call, etc).

An activity pointer is actually a full fledged activity of a specific type.

ActivityPointer (activity) entity

The activity pointer (activity) entity represents any activity or task that is performed, or to be performed by a user. An activity is any action for which an entry can be made on a calendar.

Whenever you create an activity record in Microsoft Dynamics 365, a corresponding activity pointer record is created. This indicates that the activity record and the corresponding activity pointer record have the same value for the ActivityId attribute. For example, if you create an Email record, the attribute values of Email.ActivityId and the corresponding ActivityPointer.ActivityId will be the same.

To update the fields in the activity pointer, update the activity that activity pointer relates to. For example with a task:

Entity e = new Entity("task");

e.Id = "Your Id Goes Here";
e["subject"] = "Your new subject";

Service.Update(e);
James Wood
  • 17,286
  • 4
  • 46
  • 89