# Managed Object - CustomFieldsManager(vim.CustomFieldsManager)

Property of
  ServiceContent
See also
  CustomFieldDef, ManagedEntity, PrivilegePolicyDef
Since
  2.0

## Managed Object Description

The CustomFieldsManager object is used to add and remove custom fields to managed entities.

The custom fields values set on managed entities are available through the CustomValue property and through the summary objects for VirtualMachine and HostSystem. They are not available directly through this managed object.

This functionality is only available through VirtualCenter.

Properties

Name | Type | Description
--- | --- | ---
field* P | CustomFieldDef[] | List of custom fields defined on this server. The fields are sorted by name.

*May not be present P Required privilege: System.View

Methods

Methods defined in this Managed Object
AddCustomFieldDef, RemoveCustomFieldDef, RenameCustomFieldDef, SetField

# AddCustomFieldDef(addFieldDefinition)

Creates a new custom field. If the moType is specified, the field will only be available for that type of managed object.

Required Privileges
  Global.ManageCustomFields

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
name P | xsd:string | The name of the field. Since 2.0
moType* P | xsd:string | The managed object type to which this field will apply Since 2.0
fieldDefPolicy* P | PrivilegePolicyDef | Privilege policy to apply to FieldDef being created Since 2.0
fieldPolicy* P | PrivilegePolicyDef | Privilege policy to apply to instances of field Since 2.0

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
CustomFieldDef |

Faults

Type | Description
--- | ---
DuplicateName | Thrown if a custom field with the name already exists.
InvalidPrivilege | Thrown if a specified privilege is not defined.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="AddCustomFieldDef" type="vim25:AddCustomFieldDefRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="AddCustomFieldDefResponse"> <complexType> <sequence> <element name="returnval" type="vim25:CustomFieldDef"/> </sequence> </complexType> </element>

# RemoveCustomFieldDef(removeFieldDefinition)

Removes a custom field. This also removes all values assigned to this custom field.

Required Privileges
  Global.ManageCustomFields

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
key P | xsd:int | The unique key for the field definition. Since 2.0

P Required privilege: key

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="RemoveCustomFieldDef" type="vim25:RemoveCustomFieldDefRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="RemoveCustomFieldDefResponse"> <complexType/> </element>

# RenameCustomFieldDef(renameFieldDefinition)

Renames a custom field.

Required Privileges
  Global.ManageCustomFields

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
key P | xsd:int | The unique key for the field definition. Since 2.0
name P | xsd:string | The new name for the field. Since 2.0

P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
DuplicateName | Thrown if a custom field with the name already exists.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="RenameCustomFieldDef" type="vim25:RenameCustomFieldDefRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="RenameCustomFieldDefResponse"> <complexType/> </element>

# SetField(setField)

Assigns a value to a custom field on an entity.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
entity P | ManagedObjectReference to a ManagedEntity | Since 2.0
key P | xsd:int | Since 2.0
value P | xsd:string | Since 2.0

P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="SetField" type="vim25:SetFieldRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="SetFieldResponse"> <complexType/> </element>