While working with the CRM Rollup messages this morning, I found either a bug or a documentation error in the activitypointer.statecode property.

The statecode is a field type of the ActivityPointerStateInfo class, which has two properties: formattedvalue and Value.

formattedvalue should be a string representation of the ActivityPointerState Enumeration, and the Value should be the numerical equivalent, as shown below:

Canceled = 2
Completed = 1
Open = 0
Scheduled = 3

But, this does not appear to be the case. When I examine the activitypointer class inside of Visual Studio, I see the following:

 

As you can see, formattedvalue is null, while the Value property is the textual representation of the ActivityPointerState Enumeration.

Just FYI should you be expecting to find a number in the Value property.

 

A possible work around:

A possible solution to this issue is to use the statuscode property. As you can see from the above picture, it has the correct name and Value pairs.