Create a Custom Action - Precisely_EnterWorks - EnterWorks - 11.0

EnterWorks Guide

Product type
Software
Portfolio
Verify
Product family
EnterWorks
Product
Precisely EnterWorks
Precisely EnterWorks > EnterWorks
Version
11.0
Language
English
Product name
Precisely EnterWorks
Title
EnterWorks Guide
Copyright
2024
First publish date
2007
Last updated
2025-01-07
Published on
2025-01-07T07:44:20.997000

In this section we will configure a custom action button both in the EnterWorks UI as well as in the New UI. The steps to do so are:

  1. Configure an HTML page and a JSP page to gather user input
  2. Configure the attribute to use the Custom Action
  3. Verify that the Custom Action works

Configure an HTML page and a JSP page to gather user input

The first step in configuring a custom action button is to set up an HTML page to collect user input.

  1. Create an HTML page and place it in the following folder:
    \\<server>\d$\Enterworks\EnableServer\tomcat\webapps\webcm\custom
  2. Create a JSP file in the same folder and name it accordingly. For example: AnalogAction.jsp. Do not worry too much about what is in the JSP file for now; we just want it there so that we can point to it.
  3. Create a copy of the JSP file and change its extension to an HTML extension. This must be done because the New UI looks for an HTML file rather than JSP file.
  4. Move the new HTML file to the following folder where the New UI will access it:
    \\<server>\d$\Enterworks\enable2020\custom
  5. Now that we have set up the JSP and HTML files in both folders, we can access the attribute properties to point to those files in the EnterWorks UI and the New UI.

Configure the attribute to use the Custom Action

To configure an attribute with a custom action:

  1. In the EnterWorks classic UI, open the Feature Bar and find the repository that contains the attribute that will use the custom action.
  2. Click the arrow to the right of the repository's name to open the action menu, select Edit, and select Attribute Properties.
  3. Scroll to the attribute the custom action will be applied to and edit the following settings as desired:
    • Calculation Label: Used for defining a custom action. This is the label that will appear if you hover over the custom action icon.
    • Calculation URL: Used for defining a custom action. When you click this field, a window will appear that has the following fields:
      • Calculation Ind: The action to occur when you click the custom action icon.
        • <none>: No calculation indicator will be displayed. This is the default for any attribute for which no calculations are to be performed.
        • Open as Dialog: The selected JSP/HTML page will be opened as a dialog prompt.
        • No User Interface: The selected JSP/HTML page will be opened in the background. There will not to be any user input fields on the form.
        • Open as Window: The selected JSP/HTML page will be opened in a new window.
        • Hidden Window:  The selected JSP/HTML page will be opened in the background. No pop-up is shown.
        • Control with Window: A pop-up window will appear that has a button for the attribute. Clicking the button triggers the JSP/HTML page. The attribute will not be updated.
        • Control with Hidden Window: A hidden pop-up window will appear that has a button for the attribute. Clicking the button triggers the JSP/HTML page. The attribute will not be updated.
        • Calculated Attribute: The attribute value may be updated by the custom action. This is used for an attribute that is going to be updated by a pop-up page but there is not a button to open the page.
      • Calculation URL: The name of the custom action HTML/JSP file that will be invoked when the custom action button is clicked.
  4. When you have finished editing, click the Save button and close the window.
  5. Clear the cache.

Verify that the Custom Action works

To verify that the attribute's custom action has been defined correctly in both the Classic UI and New UI, in each UI open a record and click the custom action button on the attribute. When you click the button, it should open your HTML/JSP page.