EntityActions
An EntityAction provides a simple mechanism to extend an EntityView. It allows a user to edit the values in an EntityView, then resubmit it for implementation. EntityActions can apply globally on the EntityView, and also at the ChildView level.
An example action is one that requires the user to select an entry in a list in order to focus an action (e.g., selecting a particular line in a list of order lines, in order to take action on that particular line).
Action process
When the user clicks on a button indicating they want to take an action, the button supplies the name of the view and the action name. The view that the button retrieves represents a set of properties that must be populated for the action to occur.
The user interface then calls for the view, which provides the ForAction property. The ForAction property indicates that the user intends to edit the view, so additional policies are returned to support editing (for example, constraints, closed vocabulary list, and so on).
If there is a view, a dialog box opens and displays properties from the view in an editable display. When the user clicks OK, the view is sent back to the Commerce Engine. The engine now has the populated properties and the desired action, so the action can be processed to return a normal command result.
Viewless actions
It is possible that there is no view required for an action (for example, when deleting an entity). The EntityView has all required information, so there is no need to collect additional information from the user to complete the action.
The RequiresConfirmation property indicates the user interface should display a dialog box to confirm that the user wants to take an action before allowing it, or if the action should proceed automatically when the user clicks the button.
Multistep actions
Some action executions require multiple steps. For example, when entering an address the user first selects the country, then the county-specific properties and closed vocabulary lists are presented. For example, the StateProvince property provides the list of states or provinces depending on the country selected.