Execute Functions
In Dynamics 365 CRM, functions are a way to add server side operations that are not easily defined as CRUD operations such as create, retrieve, update and delete on entities.
Functions can return data. Functions are useful for returning information that does not correspond directly to an entity or collection.
A function can target a single entity or a collection. In OData terminology, this is the binding. You can also have unbound functions, which are referred to as static operations on the service.
Use this action to execute the functions as analysed from Dynamics 365 CRM metadata.
Using the Execute Functions Action
To use this action in your workflow, connect it to ThingWorx Flow. To connect to the flow, do the following:
1. Drag the Execute Functions action under the Dynamics 365 CRM connector to the canvas, place the pointer on the action, and then click or double-click the action. The Execute Functions connection window opens.
2. Edit the label name, if needed. By default, the label name is same as the action name.
3. To add a new authorization, refer to the Authorize Dynamics 365 CRM section in the Dynamics 365 CRM connector topic.
* 
If you previously added a Dynamics 365 CRM authorization, select an authorization from the list.
4. Select a Dynamics 365 CRM Function to execute. The fields for input in the Execute Function action window change, depending on the Dynamics 365 CRM function that you select.
For example, if you select GetQuantityDecimal-opportunity function, the following properties appear on the input form:
entity
Product—The product for which to get the quantity decimal value of
UoM—The unit of measure (unit).
The GetQuantityDecimal-opportunity function gets the quantity decimal value of a product for the specified entity in the target.
5. Enter the property details, and then click Done.
Dynamic Output Schema
The Execute Functions action returns a dynamic output schema depending on the Dynamics 365 CRM function that you select. If the action does not have a return type, it returns a message string.
See a sample output schema in the figure that follows when you select the GetQuantityDecimal-opportunity function:
Was this helpful?