Delete a Field or Field Group
Fields and field groups can be deleted as long as they are not in use. When a custom field or field group is attached to a template, it is considered "in use". If a user tries to delete a field or field group that is in use, an error is returned along with a list of the templates to which the field/group is attached.
Note: The “In Use” validation occurs at the profile data level. Prior to Release 2.1, validation was at the Template level.
-
When deleting fields and field groups:
-
One or more root-level fields/groups can be deleted in a single request.
-
Deleting a root-level field/group is only permitted if it is not used on any templates.
-
If field/group is used, the error message contains a list of templates that the field/group is associated to (template ID and name). If the list is more than 100 templates, only first 100 are returned and a count of the total number. Paging through the templates is not supported.
-
A child field can be removed from a group.
-
One or multiple child fields of the same group can be deleted in a single request.
-
The child field(s) of only one or more groups can be deleted in a single request. Child fields of multiple groups cannot be deleted in a single request.
-
A child field can only be deleted in its parent group is not used on any templates.
-
If the parent group is used, the error message contains a list of templates to which the field/group is associated (template ID and name). If the list is more than 100 templates, only the first 100 are returned and a count of the total number. Paging through template is not supported.
Important! See Modify a Field or Field Group for details on using ProfileModifyFieldReq to delete or force deletion of a custom field.
Delete a Custom Field or Group from a Template
The CustomFieldDelete and CustomFieldGroupDelete elements in ProfileModifyTemplateReq/TemplateModifyCmd can be used to delete custom fields and field groups that are not "in use" from templates.
For the deletion of any custom field/group:
- If the field has active profile data:
- And the action is Force DELETE, the field is deleted and marked as DEPRECATED. All impacted/active profile data is cleaned up by a batch process.
- And the action is simple DELETE, the list of profiles to which the field/group is attached is returned. If the number of profiles is more than 100 only the number/count of profiles is returned. The profile list contains summary information about the profile, not the full profile. A warning message is also returned: Association of custom field with template will also get deleted.
- If there is no active profile data for the custom field/group, the field is deleted.
Note: The deletion applies to both field and field group.
- When a field group is deleted, all child fields are automatically deleted.
- To delete a child field independently, use the Modify a Field or Field Group service.