The SystemDocumentListEntry API provides methods for setting the record fields in the Document List Entries [ds_document_list_entry] table.

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 using the methods in this API, add a document with its version and create a document list. Use the DocumentListEntryService API to add or remove documents from a document list.

Before using the methods in this API, you must add a document with its versions, and create a document list.

SystemDocumentListEntry - SystemDocumentListEntry(String listID)

Instantiates a SystemDocumentListEntry object.

Table 1. Parameters
Name Type Description
listSysId String Sys_id of a document list record in the Document Lists [ds_document_lists] table.
Table 2. Returns
Type Description
None

Example

The following example shows how to instantiate a SystemDocumentListEntry object.

var docList = new sn_doc_services.SystemDocumentListEntry("<docListSysId>");

SystemDocumentListEntry - description(String description)

Sets the Description field of a document list entry record.

Table 3. Parameters
Name Type Description
description String Description of the document list entry.
Table 4. Returns
Type Description
None

Example

The following example shows how to add a description to the document list entry provided using the constructor. See also DocumentListEntryService API.

var docListEntry = new sn_doc_services.SystemDocumentListEntry('21afddea2460fc10f877a6fed1c2b0dd');

docListEntry.description('birth');

var dlEntrySvc = new sn_doc_services.DocumentListEntryService();
gs.info(JSON.stringify(dlEntrySvc.createDocumentListEntry(docListEntry), null, 2));
Output:
{
  "message": "Create List Entry , List Entry sysId : d3f0b13624e8fc10f877a6fed1c2b0d9is successful.",
  "request_id": "d3f0b13624e8fc10f877a6fed1c2b0d9",
  "status": "success"
}

SystemDocumentListEntry - document(String docSysId)

Specifies the document template to add to a document list.

To define a document as a template:
  • Define the document object setting the SystemDocument – template() method to true. Create or update the document record with the methods in the DocumentService API.
  • Select the Template check box of a document in the Documents [ds_document] table.
The document record specified must have a version. Use the following APIs to define and add a document version:
Table 5. Parameters
Name Type Description
docSysId String Sys_id of a document record in the Documents [ds_document] table. The document specified must be a template and have a version.
Table 6. Returns
Type Description
None

Example

The following example shows how to add a document template as a document list entry. See also DocumentListEntryService API.

var docListEntry = new sn_doc_services.SystemDocumentListEntry('21afddea2460fc10f877a6fed1c2b0dd');
docListEntry.document("9acd7fea24587410f877a6fed1c2b060");
docListEntry.description('birth certificate');

var dlEntrySvc = new sn_doc_services.DocumentListEntryService();
gs.info(JSON.stringify(dlEntrySvc.createDocumentListEntry(docListEntry), null, 2));
Output:
{
  "message": "Create List Entry , List Entry sysId : d3f0b13624e8fc10f877a6fed1c2b0d9is successful.",
  "request_id": "d3f0b13624e8fc10f877a6fed1c2b0d9",
  "status": "success"
}

SystemDocumentListEntry - documentList(String listSysId)

Specifies the document list in which to add a document.

Note: You can alternatively set the document list as a parameter in the SystemDocumentListEntry() constructor.
Use the following APIs to define and create a document list:
Table 7. Parameters
Name Type Description
listSysId String Sys_id of a document list record in the Document Lists [ds_document_lists] table.
Table 8. Returns
Type Description
None

Example

The following example shows how to set the document list in which to add a document. See also DocumentListEntryService API.

var docListEntry = new sn_doc_services.SystemDocumentListEntry();

docListEntry.documentList('21afddea2460fc10f877a6fed1c2b0dd');
docListEntry.document('deaef1ce24103410f877a6fed1c2b085');
docListEntry.description('passport');

var dlEntrySvc = new sn_doc_services.DocumentListEntryService();
gs.info(JSON.stringify(dlEntrySvc.createDocumentListEntry(docListEntry), null, 2));
Output:
{
  "message": "Create List Entry , List Entry sysId : c4ccaa8b24283050f877a6fed1c2b003is successful.",
  "request_id": "c4ccaa8b24283050f877a6fed1c2b003",
  "status": "success"
}