Actions in the Code On Time user interface are displayed based on several conditions. When the conditions are fulfilled, the action is displayed. The When Last Command Name condition will only display an action when the previous action matches the specified command name. If When Last Command Name is null, the action will be displayed if Select action or no action is performed and the other conditions are matched.
For example, when a Customers record is selected, the Edit, Delete, and Close actions are displayed. New Customers action is available on the action bar, as well as Actions and Report dropdowns.
When the Edit action is activated, the buttons are replaced by OK, Delete, and Cancel. The action bar only has one dropdown, Record.
Note that all reporting actions have been hidden. Let’s add another Report action what will only be displayed after Edit action has been performed.
Start the Project Designer. In the Project Explorer, switch to the Controllers tab. Right-click on Customers / Actions / ag7 (ActionBar) – Report node, and press New Action.
Assign the following values:
Property | Value |
Command Name | Report (PDF) |
Header Text | Create a report |
When Last Command Name | Edit |
Description | Creates a PDF report when editing a record. |
Press OK to save the action. On the toolbar, press Browse.
Navigate to Customers page and select a record. The new Report action is not displayed.
Start editing the record. The new action will appear as the only option in the Report dropdown.