3.3.4.147 UpdateCustomField

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 2.2.2.1:

  1. Set updatedCustomField variable as UpdateCustomField.customField.

  2. If updatedCustomField is NULL, an appropriate SOAP fault MUST be returned.

  3. Validate the updatedCustomField by performing the processing rules as listed in the procedure ValidateCustomField.

  4. 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.

  5. If the list of modified properties of object updatedCustomField also includes CustomFieldOrigin and/or CustomFieldType field, an appropriate SOAP fault MUST be returned.

  6. 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.

  7. Fetch the existing CustomField data by invoking GetCustomField procedure of ADM_CustomFieldsTable by passing the updatedCustomField.RecordId as the Param_id input parameter.

  8. Store the Result_customField in currentCustomField which is a temporary store.

  9. For each of the modified properties of object updatedCustomField, if the property is not CustomFieldOrigin, CustomFieldType or CustomFieldValues fields, then do the following:

  10. Get the oldValue of the property from currentCustomField.

  11. Get the newValue of the property from updatedCustomField.

  12. If oldValue is equal to NULL, or if newValue is equal to NULL, or if oldValue is not equal to newValue, then:

  13. 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.

  14. If the list of modified properties of object updatedCustomField includes CustomFieldValues field the following processing steps are performed:

  15. For each CustomFieldValue currentValue in currentCustomField.CustomFieldValues:

  16. If there is an entry newValue in updatedCustomField.CustomFieldValues having Id equal to currentValue.Id:

  17. If currentValue.Value is not equal to newValue.Value:

  18. 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.

  19. Update the newValue.Value in ADM_CustomFieldValuesTable.

  20. Remove the newValue entry from the updatedCustomField.CustomFieldValues collection.

  21. If there is no entry in updatedCustomFields.CustomFieldValues having Id equal to currentValue.Id:

  22. If currentValue.BuiltInCustomFieldValueId is not set, remove the entry.

  23. If currentValue.BuiltInCustomFieldValueId is set, generate and return an appropriate SOAP fault as the build-in custom field values MUST NOT be removed.

  24. For each CustomFieldValue newValue in updatedCustomField.CustomFieldValues:

  25. 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.