Feature service Update method

Updates features or objects in a layer or table using the input array.

EditResult[] Update(int LayerorTableID, DataObject[] DataObjectArray, string VersionName, boolean RollbackOnFailure, boolean RollbackOnFailureSpecified)

Parameter

Description

LayerorTableID

The ID of the layer or table in which to update features or objects.

DataObjectArray

The features or objects to be updated in the service.

VersionName

Geodatabase version to apply the edits. This parameter applies only to feature services that expose geodatabases. If not specified, edits are applied to the published map's version.

RollbackOnFailure

RollbackOnFailure determines whether edits will be applied in a transactional manner. If set to true, and any of the edits fail, the entire edit operation will fail. If set to false, if some portion of the edits fail, they will not be applied. However, the edit operation will succeed and all others edits will be applied.

Not all data supports setting this parameter. Query the SupportsRollbackonFailureParameter property of the DataObjectTable to determine whether or not a layer supports setting this parameter. If SupportsRollbackonFailureParameter = false for a layer, then when editing this layer, RollbackOnFailure will always be true, regardless of how the parameter is set. However, if SupportsRollbackonFailureParameter = true, this means the RollbackOnFailure parameter can be set to true or false on edit operations.

RollbackOnFailureSpecified

Indicates if RollbackOnFailure is specified.

Return Value

This method returns an array of EditResult objects whose order is consistent with the order of the features or objects in the input DataObjectArray parameter. Each contains the ObjectID (EditResult.OID) and GlobalID (EditResult.GlobalID) assigned to the feature or object when it was added. If updating a feature or object fails (EditResult.Succeeded is false), the returned object will have the error code (EditResult.Code) and description (EditResult.Description).

Remarks

If an input feature or object only has some properties, only those will be updated. Some DataObject properties, such as ObjectID and GlobalID are not editable. If these properties are set, they will be ignored when applied to the service.

10/23/2013