DocumentService - Scoped, Global
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- API reference
The DocumentService API provides methods for creating, deleting, and updating a document.
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.
A document is a collection of information about a document record. The methods used to create or update a record modify fields using the SystemDocument object.
- SystemDocumentVersion – Define a document version as the source of the document content. 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.
- DocumentVersionService – Document content is managed using versions.
Use the DocumentReferenceService API to manage documents referenced in a target table, such as the Incidents [incident] or Knowledge [kb_knowledge] table.
- SystemDocumentList – Define a list of document templates.
- DocumentListService – Add or remove a document template list.
- SystemDocumentListEntry – Define a document template list entry.
- DocumentListEntryService – Add or remove a document template list entry.
DocumentService - DocumentService()
Instantiates a DocumentService object.
Name | Type | Description |
---|---|---|
None |
Example
The following example shows how to instantiate a DocumentService object.
DocumentService - createDocument(SystemDocument doc)
Creates a document record in the Documents [ds_document] table.
Name | Type | Description |
---|---|---|
doc | SystemDocument | One or more properties representing fields of a new record. The name property is required and can be set using the SystemDocument constructor or name() method. |
Example
The following example shows how to populate SystemDocument object properties and create a new document record.
DocumentService - deleteDocument(String docSysId)
Removes a document record from the Documents [ds_document] table.
Name | Type | Description |
---|---|---|
docSysId | String | Sys_id of a document record in the Documents [ds_document] table. |
Example
The following example shows how to delete an existing document record.
DocumentService - updateDocument(String docSysId, SystemDocument doc)
Updates the field values of an existing document record.
Name | Type | Description |
---|---|---|
docSysId | String | Sys_id of a document record in the Documents [ds_document] table. |
doc | SystemDocument | One or more properties representing document fields to be updated. |