SystemDocumentVersion - Scoped, Global

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 9분
  • The SystemDocumentVersion API provides methods for setting the values of a document's source version in the Versions [ds_document_version] 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.

    To create a document version, use the DocumentVersionService API.

    SystemDocumentVersion - SystemDocumentVersion(String docSysId)

    Instantiates a SystemDocumentVersion object.

    표 1. Parameters
    Name Type Description
    docSysId String Sys_id of a document record in the Documents [ds_document] table.
    표 2. Returns
    Type Description
    None

    The following example shows how to instantiate a SystemDocumentVersion object and create a document version. See also DocumentVersionService.

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));

    Output:

    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : d5a340d9242cf810f877a6fed1c2b069 is successful.",
      "request_id": "d5a340d9242cf810f877a6fed1c2b069",
      "status": "success"
    }

    SystemDocumentVersion - document(String docSysId)

    Specifies the document record for this version.

    주:
    You can alternatively set the name as a parameter in the SystemDocumentVersion() constructor.
    표 3. Parameters
    Name Type Description
    docSysId String Sys_id of a document record in the Documents [ds_document] table.
    표 4. Returns
    Type Description
    None

    The following example shows how to set the name field of a document version. See also DocumentVersionServicecreateDocumentVersion().

    var versionDefinition = new sn_doc_services.SystemDocumentVersion();
    
    versionDefinition.document('491efbee24187410f877a6fed1c2b0a9');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    Output:
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : 1c504c91242cf810f877a6fed1c2b08b is successful.",
      "request_id": "1c504c91242cf810f877a6fed1c2b08b",
      "status": "success"
    }

    SystemDocumentVersion - type(String docType)

    Sets the Type field of a document version.

    표 5. Parameters
    Name Type Description
    docType String Document source type.
    Valid values:
    • url
    • attachment
    Default: attachment
    주:
    An attachment can currently only be added in the Document Versions [ds_document_version] table UI and not with the API.
    표 6. Returns
    Type Description
    None

    The following example shows how to set the type field and create a document version. See also DocumentVersionService.

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : d5a340d9242cf810f877a6fed1c2b069 is successful.",
      "request_id": "d5a340d9242cf810f877a6fed1c2b069",
      "status": "success"
    }

    SystemDocumentVersion - url(String url)

    Sets the URL of a document version.

    표 7. Parameters
    Name Type Description
    url String URL of the source document for this version.
    표 8. Returns
    Type Description
    None

    The following example shows how to set the URL field as the source of a document version. See also DocumentVersionService.

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : d5a340d9242cf810f877a6fed1c2b069 is successful.",
      "request_id": "d5a340d9242cf810f877a6fed1c2b069",
      "status": "success"
    }

    SystemDocumentVersion - versionNumber(Number versionNumber)

    Sets the number of a document version.

    표 9. Parameters
    Name Type Description
    versionNumber Number Version number for this document.
    표 10. Returns
    Type Description
    None

    The following example shows how to set the version number and create a document version. See also DocumentVersionService.

    var versionDefinition = new sn_doc_services.SystemDocumentVersion('491efbee24187410f877a6fed1c2b0a9');
    
    versionDefinition.type('url');
    versionDefinition.url('http://one/1.0');
    versionDefinition.versionNumber(5);
    
    var versionSvc = new sn_doc_services.DocumentVersionService();
    gs.info(JSON.stringify(versionSvc.createDocumentVersion(versionDefinition), null, 2));
    Output:
    {
      "message": "Adding an entry to DocumentVersion for the given docId : 491efbee24187410f877a6fed1c2b0a9, sysId : ff47449d242cf810f877a6fed1c2b06c is successful.",
      "request_id": "ff47449d242cf810f877a6fed1c2b06c",
      "status": "success"
    }