Share via


IReplicaMetadata::FindItemMetadataByUniqueIndexedFields

Returns the unique item metadata entry that has the specified value for the indexed field.

HRESULT FindItemMetadataByUniqueIndexedFields(
  LPCWSTR * ppcszCustomFieldNames,
  IFieldValue ** ppFieldValues,
  BYTE cCustomFields,
  IItemMetadata ** ppItemMetadata);

Parameters

  • ppcszCustomFieldNames
    [in, size_is(cCustomFields)] The set of indexed field names that define the items for which to search. These field names must be in the same order as that used to specify the index when ISyncMetadataStore::InitializeReplicaMetadata was called.
  • ppFieldValues
    [in, size_is(cCustomFields)] The set of indexed field values that define the items for which to search. These values must be in the same order as the names in ppcszCustomFieldNames.
  • cCustomFields
    [in] The number of entries in ppcszCustomFieldNames and in ppFieldValues.
  • ppItemMetadata
    [out] Returns the unique item metadata entry that has the specified value for the indexed field.

Return Value

  • S_OK

  • S_FALSE if no matching item is found.

  • E_POINTER

  • SYNC_E_METADATA_QUERY_REQUIRES_UNIQUE_INDEXED_FIELDS if a field in ppcszCustomFieldNames was not specified as a unique index field when the metadata was initialized.

  • SYNC_E_METADATA_QUERY_REQUIRES_INDEXED_FIELDS if a field in ppcszCustomFieldNames was not specified as an index field when the metadata was initialized.

  • SYNC_E_METADATA_FIELD_INVALID_NAME if a field name in ppcszCustomFieldNames does not exist.

  • SYNC_E_METADATA_FIELD_INVALID_TYPE if a field value in ppFieldValues does not match the type of the corresponding field.

Remarks

Custom fields must be established when the replica metadata is first initialized by passing a list of CUSTOM_FIELD_DEFINITION structures to ISyncMetadataStore::InitializeReplicaMetadata.

Index fields must be established and marked as unique when the replica metadata is first initialized by passing a list of CUSTOM_FIELDS_INDEX structures to ISyncMetadataStore::InitializeReplicaMetadata.

See Also

Reference

IReplicaMetadata Interface