Delete Fields
You can choose from two methods to delete a collection of fields. When you call the deleteFields method, you use full identifiers to specify the fields to be removed, and when you call the deleteFieldsbyUUID method, you use UUIDs. In both cases, fields and their related field options, related relationships, and related options are removed.
|
You cannot remove fields that are shared among multiple objects.
|
Field Deletion Methods
public static void deleteFields(String relatedObjectFullIdentifier, Collection<String> fieldFullIdentifiersToDelete)
public static void deleteFieldsByUUID(String relatedObjectFullIdentifier, Collection<UUID> uuids)
Example
To delete the fields created as examples:
import com.servicemax.core.utils.Definitions
Definitions.deleteFields('io_showcase', ['io_test_field', 'io_test_relationship_field', 'io_test_option_list_field'])
To delete a field created as an example by specifying its UUID (a7ff6d30-a650-45a9-ae97-d972905b11ea):
import com.servicemax.core.utils.Definitions
Definitions.deleteFieldsByUUID('io_field', [UUID.fromString('a7ff6d30-a650-45a9-ae97-d972905b11ea')])
For more information: