updateCollectionEntry()

void updateCollectionEntry(CustomCollectionEntry entry)

This method updates the existing custom collection entry identified by the key attribute of the entry provided.

Optionally it is also possible to rename the entry code of a custom collection entry, providing the new entry code is not already in use.

Parameters

entry
Format: CustomCollectionEntry XML
Purpose: Defines a CustomCollectionEntry XML document that specifies the details of the collection entry.

The key attribute of the top-level <CustomCollectionEntry> element in this argument is the sole identifier of which custom collection entry is to be updated.

The key of a custom collection is always returned by addCollectionEntry(), but you can also look up the key using findCollectionEntries() and getCollectionEntryByEntryCode().

The <CollectionCode> element must contain the name of the custom collection that the entry belongs to. It is not possible to move a custom collection entry between different custom collections.

To rename the entry code of the custom collection entry, provide a different value for the <EntryCode> element. The <Object> element in this argument will replace the existing custom object associated with the custom collection entry being updated. You must include all the fields that you wish to retain post-update - with their new values if changing, or existing values if not to be changed.

You can use the return result of getCollectionEntry() as a basis for populating this argument.

Example: Request collection entry update

This example shows a CustomCollectionEntry XML document.

<CustomCollectionEntry xmlns="http://xml.inomial.com/smile/2.xsd" key="6544">
  <CollectionCode>AirFreightDestinations</CollectionCode>
  <EntryCode>AU_Melbourne</EntryCode>
  <Object>
    <String name="airportName">Tullamarine</String>
    <String name="airportIcaoCode">YMML</String>
    <String name="airportIataCode">MEL</String>
  </Object>
</CustomCollectionEntry>

Results

This method does not return any output.

Smile emits the CustomCollectionEntryUpdated message when the task is complete.

Faults

NoSuchItemException

This fault is returned when a custom collection with the provided key does not exist.

NonUniqueFieldException

This fault is returned when an attempt to rename the entry code of a custom collection entry fails because an existing entry has the same name as the <EntryCode> element value.

CustomObjectException

This fault is returned when one or more custom fields inside the <Object> element are missing (in the case of a mandatory field), or fail to validate against a constraint that has been set for the content of that field.

Java client syntax

java -cp build/smilewsv2-client.jar [options]
 com.inomial.smile.client.v2.examples.UpdateCustomCollectionEntry
 filename
filename
Purpose: Specifies the filename of the CustomCollectionEntry XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.