Format BASED ON field-name
1 – Parameters
1.1 – field-name
Specifies the field name on whose properties you are basing a new field element.
2 – Description
The BASED ON field property bases the properties of a new field element on one that already exists. You must have privilege to read a field element to be able to base other elements upon it. You can use BASED ON field properties to define several fields related to a base field and to each other. You can use the BASED ON field property to give individual names to field elements that share the same properties. This allows you to uniquely refer to these field elements in record elements. If you want the new field to have additional properties not found in the base field, you can specify the additional properties in the DEFINE FIELD or CHANGE FIELD command.
3 – Examples
1.CDO> DEFINE FIELD SUPERVISOR_BADGE_NUMBER cont> BASED ON BADGE_NUMBER cont> VALID IF SUPERVISOR_BADGE_NUMBER > 500. In this example, the DEFINE FIELD command bases SUPERVISOR_ BADGE_NUMBER on the BADGE_NUMBER field element. The VALID IF property is an additional property that is unique to SUPERVISOR_BADGE_NUMBER. 2.CDO> DEFINE FIELD MANAGER_BADGE_NUMBER cont> BASED ON SUPERVISOR_BADGE_NUMBER cont> VALID IF MANAGER_BADGE_NUMBER > 1000. In this example, the DEFINE FIELD command bases a second field element on the element created in the previous example. The VALID IF property explicitly defined for the new element overrides the property included in the previous element. 3.CDO> DEFINE FIELD SUPERVISOR_SSN cont> BASED ON SSN. In this example, the DEFINE FIELD command creates a new element from a standard element (SSN). When you use the BASED ON property to give different names to field elements that share the same properties, you base the new elements on a field element that does not change frequently. 4.CDO> DEFINE FIELD MANAGER_SSN cont> BASED ON SSN cont> QUERY_HEADER IS "MANAGER SSN". CDO> CHANGE FIELD MANAGER_SSN cont> NOBASED ON. In this example, the NOBASED ON keyword removes the BASED ON property, but does not remove the QUERY_HEADER property, from the MANAGER_SSN field element. Because all other MANAGER_SSN properties were based on SSN, you must define new properties for MANAGER_SSN, unless the QUERY_HEADER property is adequate.