In CA Workflow, you can create text fields on forms as needed. To pre-populate text fields, you must follow the steps in this section. These steps include adding several new attributes required for the key field, the field used to capture the data used to pre-populate other text fields. This topic continues the Employee ID example started in How to Pre-Populate Text Fields in Forms.
To define attributes for pre-populated text fields
To continue the Employee ID example started in that section, ensure that the following text fields are created, and that their id attributes on the form exactly match the corresponding field names in the database: First Name, Last Name, Phone Number, Email Address, and Physical Address.
If necessary, follow the steps in Modify a Form to Include New Text Fields to create these fields and specify their attributes.
To continue the Employee ID example, open the Employee Termination form and select the Employee ID field.
The existing attributes for that field appear in the field attribute table on the bottom part of the screen: The Name and Value columns display the names and values of each attribute for the selected field. The names of the default attributes for the Employee ID field are id, label, required, and value. Your screen appears similar to the following:

That name appears as the new entry in the Name column.
Both the name and value blocks are highlighted.
Double-click inside the value column and enter the path name to the custom image (such as a magnifying glass) to use as a search icon on the form.
The default value is custom/images/icon.gif, without additional drive or directory specifications.
To use an alternative image file (filename.gif), copy it to the custom/images folder and specify custom/images/filename.gif in the value column.
Note: When users click this icon on the form, an action occurs. This action is specified by the icon_action attribute, which is described in a later step.
icon_action is the fixed attribute name.
Specifies the JavaScript function to run when the end user completing the form clicks the icon specified by the previous attribute (icon). The JavaScript function is either the ca_PopupVariableWindow(customMain) function or a custom function, as follows:
Value=ca_PopupVariableWindow(customMain)
The ca_PopupVariableWindow(customMain) function prompts the user to enter a value for the key input field. Using that value, the function runs the query for pre-populating the text fields.
In the Employee ID example, the function prompts the user to enter the user ID, and then uses that user ID to run the query for pre-populating the text fields with related personnel data such as first and last names, email address, and so forth.
Value=customCallback(custom function)
Specifies the name of the custom JavaScript function to run.
You must use the customCallback function to call your custom function. The customCallback function is included in the custom_form_example.js file.
Specify custom functions in the custom_form_lib.js file or custom_form_example.js file, as explained in JavaScript Functions for Reuse, Customization, and Troubleshooting.
icon_tooltip is the fixed attribute name.
Specifies a text string that provides the tool tip text for the icon. When users mouse-over the icon, this text displays above the icon to explain its function.
prefill is the fixed attribute name.
Specifies the id of the report data object that retrieves the data used to pre-fill the text fields on the form.
Example: $report_data.78870b102af20c13425451163b2d2370-7ff41195054288150$
Note: The field attributes named icon, icon_attribute, and icon_tooltip are specific to the CA Service Catalog implementation of CA Workflow and therefore may not be supported in another CA product's implementation of CA Workflow.
If necessary, refine the form, export it again, and test it until it works successfully.
To finalize the form, preview it and adjust it as needed, and then export it.
To finalize the form
The browse dialog appears.
Important! Ensure that you use a different file name, to prevent your changes from being accidentally overwritten by a default form included in a later patch or upgrade. Keeping the original form intact is also helpful in case you need to verify the default contents of the form later for any reason.
Note: For troubleshooting help with pre-population and JavaScript functions, see JavaScript Functions for Reuse, Customization, and Troubleshooting.
Note: Remember that the Employee ID example, is not intended as an end product to "plug into" your system as-is but rather as an illustration to demonstrate how you can modify the default forms to match your organization's unique resources and needs.
You are ready to include this form in a service or service option group, so that you can test it in an actual Catalog request.
| Copyright © 2013 CA. All rights reserved. |
|