How to Create a Custom Data Class
Custom data classes can be created by using CMDB Solution. These can be assigned to out of box resources or to custom resources to add new fields for data.
The following instructions describe how to create custom data classes. Other related articles are also referenced, as the user may also need to create custom resources, Data Connector Import Rules and custom reports.
- In a Symantec Management Platform Console, click on the Settings button > All Settings.
- Click to open the folders Service and Asset Management > Resource and Data Class Settings > Data Classes.
- On the folder to create a custom data class under, right click and choose New > Editable Data Class.
- In data class name field, enter a name for the custom data class. For example, Camera Details.
- In the Multi Rows field, click to uncheck this. If this is left checked, the custom data class will have a one-to-many relationship. By unchecking this, the custom data class will have a single field for its single value.
- Click on the "Add new attribute" button.
- In the Name field, enter the attribute's name. For example, Megapixel Size.
- Enter remaining attribute details. For example, Type can be Static List, with items that are 5 MP, 8 MP, 10 MP, 12 MP, None.
- Click on the OK button when finished editing the attribute details.
- Click on the "Add new attribute" to add any additional ones.
- Click on the "Save changes" button. Note: Many items in attributes are no longer able to be edited and changed after the data class is first saved. Ensure that this is set up correctly before doing so, otherwise it becomes difficult later, after data is entered into the custom data class, to change this to attributes that are different. Information on how to do this can be found here:
How to change custom data class attributes after they have been saved
- Add the custom data class to a custom resource or out of box resource.
a. In a Symantec Management Platform Console, under Resource and Data Class Settings (steps 1 and partially 2), click to open the Resource Types folder.
b. Find and click on the resource (whether this is out of box or custom) to add the custom data classes to.
c. Click on the "Add data classes" button.
d. In the Items Selector window, click to select any custom data classes to add.
e. Click on the Save Changes button.
Click on the resource's "Save changes" button.
How Custom Data Classes Work with Assets and in SQL
Custom data classes will create tables of the same name. These appear as "Inv_<custom data class name). For example, if the name of a custom data class is "Camera Details", this then appears as "Inv_Camera_Details", with underscore characters in-between each word. All attributes (columns) in the data class will appear in the table too.
In the database, this appears as the table Inv_Camera_Details. Its _ResourceGuid column will contain the GUID of the asset record it's related to. The following example SQL script could be used to view an asset and its custom data class:
FROM vCellphone vc
LEFT JOIN Inv_Camera_Details icd
ON icd._ResourceGuid = vc._ResourceGuid
How to create a custom resource
How to create a custom report that uses a custom resource and custom data classes
How to import data into a custom resource or custom data class using a Data Connector Import Rule
Resources are unable to be saved after using SQL to change a custom data class
Unable to create a custom data class string attribute that is larger than 4000 characters in size
Related Legacy Article
How to create custom data classes using CMDB Solution 6.5