Dynamics CRM 2013 SDK – Custom Actions

Gayan Perera, 13 September 2013

Another great addition to CRM 2013 is the ability to define custom actions. This feature is great for easily extending domain specific logic.

When a custom action is created through the UI or custom code this custom action then can be executed through the Organization Web Service similar to other requests/responses.

The custom action designer is very similar to the workflow/real-time/synchronous process designer.

High level overview of a custom action:

  • Similar to a real-time/synchronous workflow with input/output parameters
  • Can be bound to a single entity or be global. When bound to a single entity you have the ability to add Update steps
  • Can execute pre/post plugins or other real-time/synchronous plugins/processes
  • Can execute custom actions through organization.svc but NOT organizationdata.svc
  • Does not work with offline client

Input and Output Parameter Types

Following are the different data types that are available when defining input/output parameters on a custom action.

  • String
  • Integer
  • EntityReference
  • EntityCollection
  • Decimal
  • Money
  • DateTime
  • Boolean
  • OptionSet

Executing a Custom Action

There are 2 ways of executing a custom action. First is to generate early bound classes using to CrmSvcUtil.exe to give you easy access to these custom actions input/output parameters. Second is to use the raw ExecuteRequest class and specify the input parameters using the Parameters property.