RenameDBField
Mon 01 January 2018Syntax
RenameDBField(Field.NewFieldName, Field.OldFieldName [, FixRefsOnly])
Description
Use the RenameDBField function to modify a field definition to have a new name. This function also cleans up most references, such as in PeopleCode programs and on records so they now use the new name.
Note: Because using this function changes records that are used to build application tables, you must rebuild (alter) the specified project before these changes can be used.
Parameters
Field or Control |
Definition |
---|---|
NewFieldName |
Specify the new field name to be used. This name must be prefixed by the reserved word Field . |
OldFieldName |
Specify the name of the field to be changed. This name must be prefixed by the reserved word Field . |
FixRefsOnly |
Specify to rename all references of OldFieldName to NewFieldName whether or not NewFieldName exists or not. This paramter takes a Boolean value. The default value is False. For example, suppose a company renames a field PROJECT to MYPROJECT. Then they receive a patch which has records, pages, code, and so on that references Field.PROJECT. In this case you could set this parameter to True, rename MYPROJECT to PROJECT, and have all the references to the field PROJECT redirect to the field MYPROJECT even if neither field exists in the database, nor if only one exists. Note: Using this parameter is a completely freeform path to renaming references. Be aware that the system won't work if pages and records are not eventually pointing to a valid field. |
Returns
A constant value. The values are:
Value |
Description |
---|---|
%MDA_Success |
Bulk operation completed successfully. |
%MDA_Failure |
Bulk operation did not complete successfully. |
%MDA_FieldNotFound |
The field specified by OldFieldName wasn't found in the specified project or page list. |
%MDA_Duplicate |
The field specified by NewFieldName already exists. |