IItemMetadata::SetFieldString

Sets the value of a string field.

Syntax

HRESULT SetFieldString(
  LPCWSTR pcszFieldName,
  LPCWSTR pcszValue);

Parameters

  • pcszFieldName
    [in, string] The name of the field.

  • pcszValue
    [in, unique] The value of the field.

Return Value

  • S_OK

  • E_POINTER

  • E_INVALIDARG

  • SYNC_E_METADATA_FIELD_INVALID_NAME if the field does not exist.

  • SYNC_E_METADATA_FIELD_INVALID_TYPE when the field is not the string type in the custom field schema.

Remarks

The field value can be reset to an empty value by specifying NULL for pcszValue.

Custom fields must be defined by using a CUSTOM_FIELD_DEFINITION structure when the replica metadata is first initialized.

Note

This method does not save the change to the store. IReplicaMetadata::SaveItemMetadata must be called to save all changes that have been made to the IItemMetadata properties.

See Also

Reference

IItemMetadata Interface