Adding an Attribute

An attribute is a piece of information that resides in a class. Attributes can also be referred to as properties or data members of the class. Using attributes, you can collect a variety of information about an object.
Some examples of class attributes are:
If your organization needs to collect some information on an object that is not part of the core APM application (for example, on assets), you can add one or more attributes to a custom class to provide a place to collect and store the information.
This topic explains how to add a new attribute to an existing custom class, using an example customization of the work request class. In this example, you will make the following changes to the custom Work Request class:
Note: You must launch the product as an APM administrator.

To Add an Attribute to a Custom Class

1.
2.
Select the Customization Center view.
3.
Click Lock for Customization. The APM icon in your system tray now has a key on it:
4.
For this example, open the Work Request custom class. If the Work Request class is not yet customized, click New Custom Class then Based on APM Class, select the Work Request class from the MaintenanceManagement system, and click OK. The Class Work Request window appears.
Tip: You can view both APM and custom attributes, or custom attributes only by changing the selection in the dropdown at the bottom of the tab:
5.
On the Custom Attributes tab, click New. The Attribute dialog appears.
6.
In the Attribute name box type the name of your new attribute. For example, enter “Operations Consequence”.
7.
Select a Data type for the attribute. For this exercise, make sure that the Data type box is set to String.
8.
In the Length box, enter the maximum number of characters that you want for the attribute.
Tip: String attributes can be up to 899 characters long.
9.
Mandatory: The field is marked as mandatory and an error message is displayed when the user attempts to save or close the object.
Warning: The field is marked with a yellow line and a warning message appears when the user attempts to save or close the object.
Null value allowed: A blank value is allowed.
Note: You can also define custom validation rules and messages. For detailed instructions, see Creating Custom Validation Rules for Attributes.
10.
11.
Ensure that the Persistable option selected.
Tip: Select a characteristic and press F1 to learn more about the option.
Note: On the States tab, you can review the state groups in which this relationship is included. To create custom states for the relationship, see Creating Custom States. To review the views where the attribute appears, click the Usage button.
12.

Adding the Attribute to the UI

13.
In the class in which you are working, select the User Interface view. Select the Views tab and then select the second Views tab.
Tip: If the views are hidden, select the View menu, then User Interface.
14.
If the view has not yet been customized, click Customize. In the Customize a View or Panel dialog, select the view you want to customize, select a Customization type, and then click OK. For example, you can customize the New Work Request dialog.
The APM Forms Editor window for the view appears.
15.
In the Toolbox panel, select the Attributes tab and then drag the attribute that you created from the Palette onto the Layout window.
16.
For the example, move the Operations Consequence field under the Details field (in the Work Request Description section of the dialog). To do this, you might first need to increase the size of the dialog. (Click on the bottom of the dialog and drag it down with your mouse.)
17.
Tip: To quickly arrange fields and/or labels in a window, you can use the Layout options menu items. Select two or more items in the window, and then select a layout option from the menu.
When you are finished, the layout should look similar to this:
18.
19.
In the Customization Center, click Unlock System. The system should automatically regenerate the schema and cache files. This could take a few minutes to complete.
Note: If the system does not automatically generate the schema and cache, click Generate and then Schema, and Generate and then Cache Files in the Customization Center.
Note: If you are testing customizations and will not be deploying them to other users, it is possible you do not have a Server path entered in your APM run-time (registry) settings. If this is the case, you may get the message “Your server cache files path is blank. Customizations will not be deployed.” Click OK and continue. In general, having a blank server path is recommended when you are developing customizations and are not yet ready to deploy to users.
20.
Now you can test your customizations. Open the site and then navigate to your custom view. For example, select the site’s Work Request view and then click New. Your custom field should now appear on the New Work Request dialog.
Unless the new field was added to a panel, it will not yet be on any of the other work request windows. For example, to see it on the Work Request Form primary window, you would need to customize this window in a similar way.
Note: If you do not see your custom field on the view, you might have had some application windows open while performing your customizations. In this case, review the topic I cannot see my new customizations. What do I do?.