To Add a Connotation
For an action on a form toolbar or in the More menu, you can add a connotation—that is, highlight an action with a selected color. For example, you can highlight the most logical action with a green color. You can add an action connotation in an action declaration and dynamically for a particular workflow state.
All connotations are defined in the ActionConnotation enumeration. The possible values and corresponding colors are listed in the following table.
Value | Color |
---|---|
Primary | Primary color of the site theme |
Secondary | Secondary color of the site theme |
Success | Green |
Danger | Red |
Warning | Yellow |
Info | Blue |
Light | Light gray |
Dark | Dark gray |
To Add a Connotation for a Form That Uses a Workflow
In a form that uses a workflow, you can define a connotation of an action for a particular state. To define a connotation for an action, do the following:
- In the Configure method that defines the workflow, locate the state in which you want to define the action connotation.
- In the WithActions method of the state definition, locate the definition of the action for which you want to add a connotation.
- Add the WithConnotation method for the action. As a
parameter, specify the connotation that you want to add.
An example is shown in the following code.
flowState.WithActions(actions => {actions.Add(g => g.copyOrderQT, a => a.IsDuplicatedInToolbar().WithConnotation(ActionConnotation.Success))
For more details on defining a workflow, see Getting Started with Workflows: General Information and Getting Started with Workflows.
To Add a Connotation for a Form That Does Not Use a Workflow
You can add an action connotation on a form that does not use workflow. To do this, specify the connotation in the Connotation parameter of the PXButton attribute. An example is shown in the following code.
[PXButton(Tooltip = Messages.ViewXml, IsLockedOnToolbar = true,
Connotation = ActionConnotation.Success)]