DocumentVersionService - Scoped, Global
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- API reference
The DocumentVersionService API provides a service for creating and deleting document versions. Each version is an element containing the document content and is provided using a single URL or attachment. An attachment can only be added in the Document Versions [ds_document_version] table UI and not with the API.
This API requires the Document Management
plugin (com.snc.platform_document_management) and is provided within the
sn_doc_services
namespace. For information, see Document Services.
Before creating a document version, you must first define and add a document record.
- SystemDocument – Define a document object.
- DocumentService – Add, update, or delete a document.
DocumentVersionService - DocumentVersionService()
Instantiates a DocumentVersionService object.
Name | Type | Description |
---|---|---|
None |
Example
The following example shows how to instantiate a DocumentVersionService object.
DocumentVersionService - createDocumentVersion(SystemDocumentVersion docVersion)
Creates a document version record in the Versions [ds_document_version] table.
Name | Type | Description |
---|---|---|
docVersion | SystemDocumentVersion | One or more properties representing fields of a document version. |
Example
The following example shows how to populate SystemDocumentVersion object properties and create a new document version. See also SystemDocumentVersion.
DocumentVersionService - deleteDocumentVersion(String docVersionSysId)
Deletes a document version.
Name | Type | Description |
---|---|---|
docVersionSysId | String | Sys_id of a document version in the Versions [ds_document_version] table. |
Type | Description |
---|---|
Object | Success message. Error message otherwise. |
<Object>.message | Message confirming success or error. If successful, includes the sys_id of the deleted document version. Data type: String |
<Object>.status | Status indicating whether the operation is successful. Possible values:
Data type: String |
Example
The following example shows how to delete an existing document version.