The UpdateCustomField operation is used to update an existing CustomField object in the IPAM data store.
<wsdl:operation name="UpdateCustomField"> <wsdl:input wsaw:Action="http://Microsoft.Windows.Ipam/IIpamServer/UpdateCustomField" message="ipam:IIpamServer_UpdateCustomField_InputMessage" /> <wsdl:output wsaw:Action="http://Microsoft.Windows.Ipam/IIpamServer/UpdateCustomFieldResponse" message="ipam:IIpamServer_UpdateCustomField_OutputMessage" /> </wsdl:operation>
Upon receiving the IIpamServer_UpdateCustomField_InputMessage request message, the server performs the following processing steps. Upon successful completion of the steps specified below, the server MUST respond with the IIpamServer_UpdateCustomField_OutputMessage message. In the event of a failure, an appropriate SOAP fault MUST be sent to the client as specified in section 188.8.131.52:
Set updatedCustomField variable as UpdateCustomField.customField.
If updatedCustomField is NULL, an appropriate SOAP fault MUST be returned.
Validate the updatedCustomField by performing the processing rules as listed in the procedure ValidateCustomField.
Identify the list of modified properties in the updatedCustomField by seeing the number of properties modified in updatedCustomField.ModifiedProperties. If there are no property modifications, no further processing is required and return success.
If the list of modified properties of object updatedCustomField also includes CustomFieldOrigin and/or CustomFieldType field, an appropriate SOAP fault MUST be returned.
If the value of CustomFieldOrigin field is equal to CustomFieldOrigin.BuiltIn and the list of modified properties of object updatedCustomField includes one or more of the CustomFieldName, CustomFieldOrigin or CustomFieldType fields, an appropriate SOAP fault MUST be returned.
Fetch the existing CustomField data by invoking GetCustomField procedure of ADM_CustomFieldsTable by passing the updatedCustomField.RecordId as the Param_id input parameter.
Store the Result_customField in currentCustomField which is a temporary store.
For each of the modified properties of object updatedCustomField, if the property is not CustomFieldOrigin, CustomFieldType or CustomFieldValues fields, then do the following:
Get the oldValue of the property from currentCustomField.
Get the newValue of the property from updatedCustomField.
If oldValue is equal to NULL, or if newValue is equal to NULL, or if oldValue is not equal to newValue, then:
Update the value of the property to newValue in the appropriate row in the ADM_CustomFieldValuesTable, where record identifier of the row is equal to updatedCustomField.customFieldId.
If the list of modified properties of object updatedCustomField includes CustomFieldValues field the following processing steps are performed:
For each CustomFieldValue currentValue in currentCustomField.CustomFieldValues:
If there is an entry newValue in updatedCustomField.CustomFieldValues having Id equal to currentValue.Id:
If currentValue.Value is not equal to newValue.Value:
If updatedCustomField.Origin = CustomFieldOrigin.Builtin this is a value of a built-in custom field and it MUST NOT be modified. Generate and return an appropriate SOAP fault.
Update the newValue.Value in ADM_CustomFieldValuesTable.
Remove the newValue entry from the updatedCustomField.CustomFieldValues collection.
If there is no entry in updatedCustomFields.CustomFieldValues having Id equal to currentValue.Id:
If currentValue.BuiltInCustomFieldValueId is not set, remove the entry.
If currentValue.BuiltInCustomFieldValueId is set, generate and return an appropriate SOAP fault as the build-in custom field values MUST NOT be removed.
For each CustomFieldValue newValue in updatedCustomField.CustomFieldValues:
If newValue.RecordId is not set, add a new row into ADM_CustomFieldValuesTable having CustomFieldRecordId to be updatedCustomField.RecordId and the Value being newValue.Value.