Functions REST

The Functions REST activity helps to call functions using the Customer Engagement Web API and perform operations in the Microsoft Dynamics CRM server.

You can call bound, unbound, and query functions on the Microsoft Dynamics CRM server. For more information on functions, see the Dynamics 365 Customer Engagement Web API Function Reference documentation.

General

On the General tab, you can establish a connection to the Microsoft Dynamics CRM server, and specify the type of entities you want to create.

The following table lists the configurations on the General tab of the Functions REST Entity activity:

Field Module Property? Description
Name No Specify the name of the activity in the process definition.
Dynamics CRM REST Connection Yes Specify a shared connection resource.

Click the icon to select a space connection. If no matching Dynamics CRM REST connections are found, click Create Shared Resource in the Select DynamicscrmRestResource Resource Template dialog box to create one. See Creating a Dynamics CRM REST Connection for more details.

Dynamics CRM Function No Specify the function to be called.

Click Fetch Function to open the Function Selection Dialog box that contains all the available functions. Select a function from the list and click OK. The selected function is automatically specified in this field. (In the Function Selection Dialog box, if required, click Refresh List to retrieve the latest list of functions from the server.)

Entity for Bound Function No Specify the entity to be bound with a function.

Note: This field is displayed if you select a bound function in the Function Selection Dialog box.
Select the entity to be bound with the function from the Entity for Bound Function drop-down list.

Query Function No Select the check box if you want to perform a query function.
Entity for Query Function No Specify the entity on which the query function needs to be performed.

Note: This field is only displayed only after you select the Query Function check box.
Click Entity for Query Function to open the Entity Selection Dialog box that contains all the available entities. Select an entity from the list and click OK. Click Select Entity Attributes and in the Attribute Selection Dialog box, select the attributes for the query function.

CRMBaseEntity Params No

You can select either the collection or noncollection type of crmbaseentities present in input params/output return types for a Function in a Functions activity.

Note: This field is displayed only if you select the function that has crmbaseentity params/return type from the Functions Selection Dialog box.
  1. Click Select CRMBaseEntity. The CRMBaseEntity Configuration window opens.

    To configure CRMBaseEntity collection type of parameter:

    1. Select the input or output type from the Select I/O Type list.
    2. Select the parameter from the Select parameter list.
    3. Select one or more entities from the Dynamics CRM Entity list:
      • To select all the entities in the list, click Select All.
      • To remove all the selected entities, click Deselect All.
      • To see the updated entities list, click Refresh List .
    4. Click Add. The selected input/output parameters and entities appear in the List of parameters table.

    To configure CRMBaseEntity non-collection type of parameter:

    1. Select the input or output type from the Select I/O Type list.
    2. Select the parameter from the Select parameter list.
    3. To select the Dynamics CRM Entity, click Fetch Entity. Entity Selection dialog box is opened, select the entity from the list and click OK. If you want to remove the selected entity, click Clear Entity.
    4. Click Add. The selected input/output params and entities appear in the List of parameters table.
  2. Click Save and save the process to update the Functions activity with the latest configurations. To discard the changes performed, click Cancel.
  3. To delete the input/output parameters entity data, select the row to be deleted from the list and click Delete. Click Edit to make the changes in the input/output parameters, click Save Edit to save the changes or click Cancel Edit to discard the changes. You can edit only one parameter row at a time. However, you can delete multiple parameter rows at a time.

Description

On the Description tab, enter a short description for the Functions REST activity.

Input

The input of this activity varies depending on the function selected when configuring the General tab. If the function is bound, the input also varies depending on the entity that the function is bound to. For more information on the function input, see the Dynamics 365 Customer Engagement Web API Function Reference documentation.

Output

The output for this activity, displayed on the Output tab, varies depending on the function and the entity to which it is bound (if the function is bound) that you select when you configure the fields on the General tab. For more information on the function output, see the Dynamics 365 Customer Engagement Web API Function Reference documentation.

Fault

The Fault tab displays the error code and error message of the Functions REST activity. See Error Codes for a more detailed explanation of errors.

The following table lists error schema elements on the Fault tab of the Functions REST activity:

Error Schema Element Data Type Description
message String The error message returned by the plug-in.
messageCode String The error code returned by the plug-in.