Click Action
The Click Action DocType in TechMaju allows developers to configure buttons, links, and context menu items on forms and lists to make the UI more interactive, customized, and specific to user activities. These actions help streamline user interactions and enhance the overall user experience by providing easy access to common tasks and functions.
Understanding the Click Action DocType
Purpose: The Click Action DocType is designed to enable the customization of user interfaces within the TechMaju platform. It allows developers to create buttons, links, and context menu items that can be added to forms and lists, providing users with quick access to specific actions and workflows.
Function: Click actions can be used to add toolbar buttons, sidebar links, and context menu items in both form and list views. These actions can be configured to trigger JavaScript functions, navigate to specific routes, or perform other tasks. This enhances the interactivity and usability of the TechMaju application.
Role Required
TM Core Developer: Can create, write, and delete Click Actions.
Click Action Fields
Field | Description |
|---|---|
Name | The name of the Click Action. |
DocType | The DocType to which the action will be applied. |
Application | The application where the action will be used. |
Display Order | The order in which the action will be displayed. |
Active | A checkbox to activate or deactivate the action. |
Display on insert | Display the action on form insert. |
Display on update | Display the action on form update. |
Apply To | The UI element to which the action will be applied:
|
Type | The type of action for Forms:
The type of action for Lists:
|
Style | The style of the action (only applicable for Type Toolbar):
|
Group | The group under which the action will be listed in a dropdown menu, if applicable (only applicable for Forms with Type Toolbar). |
Route | The route to navigate to when the action is clicked (only applicable for Type Sidebar). |
Open route in new tab | Option to open the route in a new tab (only applicable for Type Sidebar). |
Filter Conditions | Conditions that determine when this action is triggered. |
Role Conditions | Role-based conditions for displaying the action. |
Script (JavaScript) | The JavaScript code that will be executed when the action is triggered. |
Procedure
Navigate to Develop > Click Action.
Adding a New Click Action:
Click on '+ Add Click Action' to open the creation form.
Fill in the required fields: Name, DocType, Application.
Set the Display Order to determine the position of the action.
Check the 'Active' checkbox if you want the action to be active immediately.
Optionally, check 'Display on insert' and 'Display on update' to show the action in those contexts.
Select the appropriate value for 'Apply To' (Form or List).
Select the 'Type' of action (Toolbar, Sidebar, or Menu).
If the 'Type' is Sidebar, specify the 'Route' and whether to open it in a new tab.
Define the filter conditions and role conditions as needed.
Enter the JavaScript code in the 'Script (JavaScript)' field.
Configuring the Click Action:
Adjust the filter conditions and role conditions as needed to fit the specific requirements of the DocType and the action behavior.
Use the 'Add a Filter' option to specify multiple conditions if necessary.
Saving and Viewing the Click Action:
Click on 'Apply' to save the Click Action.
The action will be available in the specified context (form or list) according to the defined conditions.
Locations of Click Actions
Form View

In the form view of a legal document, Click Actions appear in the following locations:
Toolbar: Located at the top of the form, providing buttons for various actions.
Sidebar: Located on the left side of the form, providing links for navigation or additional actions.
List View

In the list view of a legal document, Click Actions appear in the following locations:
Toolbar: Located at the top of the list, providing buttons for actions applicable to the entire list.
Menu: Located in the context menu (accessible via the three-dot menu) for individual list items, providing item-specific actions.