dynamics-crmodatadynamics-crm-webapi

Dynamics 365 API link between ActivityPointer and activitytypecode global option set


I am reading data from the ActivityPointer entity in Dynamics 365 via the API and I want to link the activitytypecode field value to the activitypointer_activitytypecode global option set, which I believe is the correct one. However the values don't seem to match. In the ActivityPointer.activitytypecode field I have values such as:

phonecall
bulkoperation
email
appointment
task

But those values don't appear in the option set definition, using this query: GlobalOptionSetDefinitions(Name='activitypointer_activitytypecode')

The option set has the code values (e.g. 4202 for Email) and the different descriptions in all languages, but nothing matches back to the values on ActivityPointer


Solution

  • Optionset is just key value pairs (4202: Email and so on), If you want to get the formatted text value of optionset (Email, Fax, etc) from your web api query results - then you have to use activitytypecode@OData.Community.Display.V1.FormattedValue to get it. Read more

    I recommend this article for complete understanding of CRM activities.

    If you are looking for the code integer value in your resultset, that seems to be an issue and the result is not the expected one - old SO thread