Click or drag to resize

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

Adds new or overwrites previous version of document's metadata

Namespace:  FileHold.LibraryManager
Assembly:  FileHold.LibraryManager (in FileHold.LibraryManager.dll) Version: 17.0.0.0
Syntax
C#
public int SetMetadata(
	int prevMetadataVersionId,
	int documentSchemaId,
	string documentName,
	FieldWithValue[] fieldsWithValues,
	bool overwritePrevious,
	string versionNumber
)

Parameters

prevMetadataVersionId
Type: SystemInt32
The metadata version ID of the document to update
documentSchemaId
Type: SystemInt32
The new document schema ID (it can be different than the current schema). Pass current document schema ID if it shouldn't be changed.
documentName
Type: SystemString
The new name of the document. Pass current document name if it shouldn't be changed. Tip for DocumentData object: use OriginalFileName if it's not null. Otherwise use value from DataColumns
fieldsWithValues
Type: FileHold.LibraryManagerFieldWithValue
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
Type: SystemBoolean
If true, the previous metadata version will be overwritten with new values (this happens only after checking in a new version when metadata should be modified without creating a separate metadata version). If false, a new metadata version will be created (the default behavior).
versionNumber
Type: SystemString
The new value of the Version Control Field, if present. Otherwise, should be null.

Return Value

Type: 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