DocumentManagerSetMetadata(Int32, Int32, String, FieldWithValue, Boolean, String) Method

Adds new or overwrites previous version of document's metadata

Definition

Namespace: FileHold.LibraryManager
Assembly: FileHold.LibraryManager (in FileHold.LibraryManager.dll) Version: 17.2.0.0
C#
[WebMethodAttribute(Description = "Adds new or overwrites previous version of document's metadata")]
[XmlIncludeAttribute(typeof(int[]))]
public int SetMetadata(
	int prevMetadataVersionId,
	int documentSchemaId,
	string documentName,
	FieldWithValue[] fieldsWithValues,
	bool overwritePrevious,
	string versionNumber
)

Parameters

prevMetadataVersionId  Int32
The metadata version ID of the document to update
documentSchemaId  Int32
This can be the existing document schema ID or it can be a new document schema ID. When it is a new document schema ID, metadata fields from the old document schema ID will have their values automatically copied to the new document ID for cases where the same field exists in both schemas.
documentName  String
The new name of the document. If the document name should not be changed, use the current document name. Tip: If you have the DocumentData object as a result of a search, the OriginalFileName property is the current document name if it is not null. In this case you can pass the document name column from DataColumns. If you are using DocumentFinder.GetDocumentsWithFields, you should include the document name in the list of fields so you have it available for this update. The document name column will normally be available in the view when you call DocumentFinder.GetDocumentsBySnapshot.
fieldsWithValues  FieldWithValue
An array of metadata field IDs and values that should be modified. It is possible to include only some fields from the schema; in that case values of other fields will not be modified. This parameter can be an empty array.
overwritePrevious  Boolean
False is the typical value. Set to true only when checking in a new document version when the metadata should be modified without creating a new metadata version.
versionNumber  String
The new value of the Version Control Field, if present. Otherwise, should be null.

Return Value

Int32

Remarks

A metadata version ID identifies a single record of metadata values for a specific version of a document. The metadata values use the same format as when adding a document. The type of the field value should be string (for text and URL fields), decimal (for numeric and currency fields), DateTime (for date fields), bool (for checkbox fields) or an array of int (for drop down and drill down fields; the values in the array are the IDs of the drop down or drill down choices).

See Also