In the example below we have 2 areas with 2 wells in each area. Our custom property field is going to be a string field that will be populated with the correct Area name. This custom field could be used by Logic, SQL queries, OPC clients, alarm banner and embedded alarm lists and mimics.
SELECT FULLNAME, MBAREANAME FROM CDBPOINT
- Right click the root object in the database tree and select Edit Metadata. The following window should appear:
- Click the Add button and select Standard. A new window should be displayed as below. Populate Field Name - it is recommended to use a unique prefix at the beginning of your field name. Leave Section as Configuration and leave the Show on Form checkbox checked to be able to see this custom field in the point's properties. In this particular example, Table is set to CDBPoint since we only want the new custom field applied to point objects. If there is a desire to use this field in any database object, the CDBObject table will need to be selected instead. We will set the Row to 1 and the column to Set Type as String and define its length - we will use 32 character long strings in this particular example. Hit the OK button once done
- You should end up with similar configuration. It is also a good practice to configure a label for your custom field to appear beside it in the properties. Click the Labels tab to do that.
- Once in the Labels tab, click the add button and configure a new label similar to the one below. Please note it is important to make sure it also uses CDBPoint as its table. In order for the label to appear beside your custom field, make sure the Row is set to 1 and the Column is also set to 1. Unlike with fields, it is possible to use spaces when configuring labels:
- Click the OK button once done and click the OK button on the Edit Metadata window. Your custom field is now created! Open properties for any point and you should see a new tab called Point and your custom metadata field labeled as Area Name.
- Populate this new custom property field for all your points. In this example, we will add Area 1 or Area 2 to the appropriate points.
- The below image shows how these custom properties can be displayed by an embedded list through a SQL query. The example of the SQL query is also provided:
SELECT FULLNAME, MBAREANAME FROM CDBPOINT