Skip to main content
Collection of all services that work with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.

Constructors

NSDocumentAgent()

Collection of all services that work with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.

Methods

CheckinDocument(Integer,String[],String,String[])

Checks in a currently checked-out document
Returns: CRMScript.NetServer.NSReturnInfo Example:

CheckoutDocument(Integer,String[])

Checks out a document for editing by the current user.
Returns: CRMScript.NetServer.NSReturnInfo Example:

CreateDefaultDocumentEntity()

Sets default values into a new NSDocumentEntity.
Returns: CRMScript.NetServer.NSDocumentEntity - The new entity with default values.
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultDocumentEntityFromSuggestion(Integer)

Returns: CRMScript.NetServer.NSDocumentEntity - The new entity.

CreateDefaultDocumentPreview()

Sets default values into a new NSDocumentPreview.
Returns: CRMScript.NetServer.NSDocumentPreview
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultSuggestedDocumentEntity()

Sets default values into a new NSSuggestedDocumentEntity.
Returns: CRMScript.NetServer.NSSuggestedDocumentEntity - The new entity.
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultTemplateVariablesParameters()

Sets default values into a new NSTemplateVariablesParameters.
Returns: CRMScript.NetServer.NSTemplateVariablesParameters
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDocumentStream(NSDocumentEntity,Bool)

Creates a new NSStream that can be used to store the document in the file archive.
Returns: CRMScript.NetServer.NSStream Example:

CreateNewPhysicalDocumentFromTemplate(Integer,Integer,Integer,Integer,Integer,Integer,Integer,String)

Creates a new document content based on a document template and store it in the document archive. Tags are substituted according to the provided IDs.
Returns: CRMScript.NetServer.NSDocumentEntity
Use GetDocumentStream to obtain the created document. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.
Example:

CreateNewPhysicalDocumentFromTemplateWithCustomTags(Integer,Integer,Integer,Integer,Integer,Integer,Integer,String[],String[],String)

Creates a new physical document based on a document template and store it in the document archive. Tags are substituted according to the provided IDs.
Returns: CRMScript.NetServer.NSDocumentEntity
Use GetDocumentStream to obtain the created document content. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.
Example:

CreateNewPhysicalDocumentFromTemplateWithCustomTags2(Integer,Integer,Integer,Integer,Integer,Integer,Integer,String)

Creates a new physical document based on a document template and store it in the document archive. Tags are substituted according to the provided IDs.
Returns: CRMScript.NetServer.NSDocumentEntity
Use GetDocumentStream to obtain the created document content. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.
Example:

CreateNewPhysicalMailMergeDocumentFromTemplate(Integer,String)

Creates a new physical document based on the documents template.
Returns: CRMScript.NetServer.NSDocumentEntity
Do not replace template tags, as the document is going to be used as a mail merge source.Use GetDocumentStream to obtain the created documents. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned. The client should not assume that any earlier, cached entity information is valid.
Example:

CreateTempFile(String)

Creates a new temporary file based on the provided stream. Specified filename may be overridden, and actual name is returned.
Returns: CRMScript.Global.String Example:

DeleteDocumentEntity(Integer)

Deletes the NSDocumentEntity
Returns: CRMScript.Global.Void Example:

DeletePhysicalDocument(Integer,String[])

Deletes the document contents
Returns: CRMScript.NetServer.NSReturnInfo Example:

DeleteTempFile(String)

Deletes a temporary file created with CreateTempFile.
Returns: CRMScript.Global.Void

ExecuteDocumentCommand(Integer,String,String[],String,String[])

Executes a custom command on a particular document, optionally a particular version
Returns: CRMScript.NetServer.NSReturnInfo Example:

GetAppointmentDocuments(Integer)

Gets all documents that are linked to the appointment (the documents that are listed in the appointment dialog).
Returns: CRMScript.NetServer.NSDocument[] Example:

GetCheckoutState(Integer)

Gets the current checkout state for a document, relative to the user performing the call.
Returns: CRMScript.NetServer.NSCheckoutInfo Example:

GetContactDocuments(Integer,Integer)

Returns a specified number of document appointments within a time range.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the contact specified. Example:

GetContactDocumentsByTemplateHeading(Integer,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by the document template heading.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the contact specified. Example:

GetContactDocumentsByTemplateType(Integer,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by document template type.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the contact specified. Example:

GetContactDocumentsByTemplateTypes(Integer,Integer,Integer[])

Returns a specified number of document appointments within a time range, filtered by document template types.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the contact specified. Example:

GetDocument(Integer)

Gets an NSDocument object.
Returns: CRMScript.NetServer.NSDocument Example:

GetDocumentCommands(Integer,String[])

Gets a list of custom commands valid for the specific document at this time.
Returns: CRMScript.NetServer.NSCommandInfo[]
This information should not be cached by clients, as it may change between documents and over time.
Example:

GetDocumentEntity(Integer)

Gets an NSDocumentEntity object.
Returns: CRMScript.NetServer.NSDocumentEntity Example:

GetDocumentList(Integer[])

Gets an array of NSDocument objects.
Returns: CRMScript.NetServer.NSDocument[] Example:

GetDocumentProperties(Integer,String[])

Gets plugin-dependent properties for the document.
Returns: CRMScript.Native.Map
A number of standard properties that should be supported by all plugins are defined in SuperOffice.CRM.Documents.Constants.Properties.
Example:

GetDocumentsByTemplateHeading(Integer)

Returns document appointments, filtered by the document template heading.
Returns: CRMScript.NetServer.NSDocument[] Example:

GetDocumentStream(Integer)

Gets the document content as a stream
Returns: CRMScript.NetServer.NSStream Example:

GetDocumentStreamFromEntity(NSDocumentEntity)

Gets the document as a stream
Returns: CRMScript.NetServer.NSStream Example:

GetDocumentUrl(Integer,String,Bool)

Gets a URL referring to the given document content.
Returns: CRMScript.Global.String - The returned string is a fully qualified URL.
This URL may be passed to the ultimate client (text editor of some kind?), which is then responsible for all further operations.Not all documents and document plugins support this feature.
Example:

GetMyPublishedDocuments()

Returns: CRMScript.NetServer.NSDocument[] Example:

GetPersonDocuments(Integer)

Gets all documents that are linked to the person (the documents that are listed in the person dialog).
Returns: CRMScript.NetServer.NSDocument[] Example:

GetPersonDocumentsByDate(Integer,Bool,Integer)

Returns a specified number of document appointments within a time range. The document appointments belong to the person specified.
Returns: CRMScript.NetServer.NSDocument[] Example:

GetPersonDocumentsByTemplateHeading(Integer,Bool,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by document template heading.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the person specified. Example:

GetPersonDocumentsByTemplateType(Integer,Bool,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by document template type.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the person specified. Example:

GetPersonDocumentsByTemplateTypes(Integer,Bool,Integer,Integer[])

Returns a specified number of document appointments within a time range, filtered by document template types.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the person specified. Example:

GetPluginCapabilities(Integer)

Gets a list of plugin-dependent capabilities for a given document archive plugin.
Returns: CRMScript.Native.Map - A standard set of properties is defined in SuperOffice.CRM.Documents.Constants.Capabilities. Example:

GetPluginList()

Gets a list of installed document plugins
Returns: CRMScript.Native.Map Example:

GetPreviewDocumentStream(Integer)

Gets the preview version of the document content as a stream. Retrieves a sanitized version if possible
Returns: CRMScript.NetServer.NSDocumentPreview Example:

GetProjectDocuments(Integer,Integer)

Returns a specified number of document appointments within a time range.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the project specified. Example:

GetProjectDocumentsByTemplateHeading(Integer,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by document template heading.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the project specified. Example:

GetProjectDocumentsByTemplateType(Integer,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by document template type.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the project specified. Example:

GetProjectDocumentsByTemplateTypes(Integer,Integer,Integer[])

Returns a specified number of document appointments within a time range, filtered by document template types.
Returns: CRMScript.NetServer.NSDocument[] Example:

GetProjectMemberDocuments(Integer,Integer)

Returns a specified number of document appointments within a time range.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the project member specified. Example:

GetProjectMemberDocumentsByTemplateHeading(Integer,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by document template heading.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the project member specified. Example:

GetProjectMemberDocumentsByTemplateType(Integer,Integer,Integer)

Returns a specified number of document appointments within a time range, filtered by document template type.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the project member specified. Example:

GetProjectMemberDocumentsByTemplateTypes(Integer,Integer,Integer[])

Returns a specified number of document appointments within a time range, filtered by document template types.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the project member specified. Example:

GetPublishedDocument(Integer)

Gets the document if it’s published
Returns: CRMScript.NetServer.NSDocument Example:

GetPublishedDocuments(Integer[])

Gets the published documents from an array of document IDs.
Returns: CRMScript.NetServer.NSDocument[] Example:

GetPublishedDocumentsByDate(Integer,Bool,Integer)

Returns a specified number of published document appointments within a time range.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments is visible to the person specified or the document is in a project the person belongs to. Example:

GetPublishedPersonDocumentsByDate(Integer,Bool,Integer)

Returns a specified number of published document appointments within a time range.
Returns: CRMScript.NetServer.NSDocument[] - The document appointments belong to the person specified or the document is in a project the person belongs to. Example:

GetPublishedProjectDocuments(Integer)

Gets published appointment documents by project ID.
Returns: CRMScript.NetServer.NSDocument[] Example:

GetSaleDocuments(Integer)

Gets all documents that are linked to the sale (the documents that are listed in the sale dialog).
Returns: CRMScript.NetServer.NSDocument[] Example:

GetSanitizedDocumentStream(Integer)

Gets the document content as a stream. Retrieves a sanitized version if possible
Returns: CRMScript.NetServer.NSStream Example:

GetSanitizedTemplateStream(String,Bool,String)

Retrieves a stream to a mail template based on its name. Sanitizes the contents if possible.
Returns: CRMScript.NetServer.NSStream Example:

GetSanitizedTemplateStreamFromId(Integer,String)

Retrieve a stream to a document template based on its ID. Sanitizes the contents if possible.
Returns: CRMScript.NetServer.NSStream Example:

GetSuggestedDocumentEntity(Integer)

Gets an NSSuggestedDocumentEntity object.
Returns: CRMScript.NetServer.NSSuggestedDocumentEntity Example:

GetTempFile(String)

Gets data stream for temporary file created with CreateTempFile.
Returns: CRMScript.NetServer.NSStream Example:

GetTemplateStream(String,Bool,String)

Retrieve a stream to a mail template based on its name
Returns: CRMScript.NetServer.NSStream Example:

GetTemplateStreamFromId(Integer,String)

Retrieve a stream to a document template based on its ID
Returns: CRMScript.NetServer.NSStream Example:

GetUnsanitizedPreviewDocumentStream(Integer)

Gets the preview version of the document content as a stream. Retrieves an unsanitized version.
Returns: CRMScript.NetServer.NSDocumentPreview
This has less CPU impact but the caller must sanitize the content before presenting it to the user.
Example:

GetVersionList(Integer)

Gets a list of existing, committed versions for a given document
Returns: CRMScript.NetServer.NSVersionInfo[] Example:

RenameDocument(Integer,String)

Rename the physical document (change the file name or equivalent concept in the document archive).
Returns: CRMScript.Global.String Example:

SaveDocumentEntity(NSDocumentEntity)

Updates the existing NSDocumentEntity or creates a new NSDocumentEntity if the id parameter is 0
Returns: CRMScript.NetServer.NSDocumentEntity Example:

SaveDocumentTemplateStream(Integer,NSStream,String,Integer)

Saves content in stream to document template file
Returns: CRMScript.NetServer.NSTemplateInfo Example:

SavePrivacyReport(String,String,Integer)

Generates a PDF from HTML and makes a document
Returns: CRMScript.Global.Integer Example:

SaveSuggestedDocumentEntity(NSSuggestedDocumentEntity)

Updates the existing NSSuggestedDocumentEntity or creates a new NSSuggestedDocumentEntity if the id parameter is 0
Returns: CRMScript.NetServer.NSSuggestedDocumentEntity Example:

SetDocumentStream(NSDocumentEntity,Bool)

Store a document’s contents from its stream. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned.
Returns: CRMScript.NetServer.NSDocumentEntity
The client should not assume that any earlier, cached entity information is valid.
Example:

SetDocumentStreamFromId(Integer)

Stores document content from stream. Since there is a potential for a name conflict (the file name stored by the document entity earlier may prove to be invalid), the (possibly amended) document entity is returned.
Returns: CRMScript.NetServer.NSDocumentEntity
The client should not assume that any earlier, cached entity information is valid.
Example:

SetTemplateStream(String,Bool,NSStream)

Saves a mail signature template to the document archive
Returns: CRMScript.Global.Void Example:

SubstituteMergeDocumentTemplateVariables(Integer,Integer,String[],String[])

Parses the source document, and replaces any template variable tags with their values, based on the associate ID.<p><p/> This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags.
Returns: CRMScript.NetServer.NSStream Example:

SubstituteMergeDocumentTemplateVariables2(Integer,Integer,Map)

Parses the source document, and replaces any template variable tags with their values, based on the associate ID.
Returns: CRMScript.NetServer.NSStream Example:

SubstituteMergeDocumentTemplateVariablesEx(Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,String[],String[])

Parses the source document, and replaces any template variable tags with their values, based on the provided identifiers. This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags
Returns: CRMScript.NetServer.NSStream Example:

SubstituteMergeDocumentTemplateVariablesEx2(Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Map)

Parses the source document, and replaces any template variable tags with their values, based on the provided identifiers. This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.
Returns: CRMScript.NetServer.NSStream Example:

SubstituteTemplateVariables(String,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,String)

Parses the source string, and replaces any template variable tags with their values, based on the IDs given in the other parameters.
Returns: CRMScript.Global.String Example:

SubstituteTemplateVariablesEx()

Parses the source string, and replaces any template variable tags with their values, based on the identities, custom values and entities specified in the other parameters.
Returns: CRMScript.Global.String Example:

SubstituteTemplateVariablesWithCustomTags(String,Integer,String[],String[],Integer,Integer,Integer,Integer,Integer,Integer,Integer,String)

Parse the source string, and replace any template variable tags with their values, based on the IDs given in the other parameters.<p><p/> This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.
Returns: CRMScript.Global.String Example:

SubstituteTemplateVariablesWithCustomTags2(String,Integer,Map,Integer,Integer,Integer,Integer,Integer,Integer,Integer,String)

Parse the source string, and replace any template variable tags with their values, based on the IDs given in the other parameters.<p><p/> This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.
Returns: CRMScript.Global.String Example:

UndoCheckoutDocument(Integer,String[])

Undoes (abandon) a checkout
Returns: CRMScript.NetServer.NSReturnInfo Example:

ValidateDocumentEntity(NSDocumentEntity)

Checks that entity is ready for saving, return error messages by field.
Returns: CRMScript.Native.Map Example:

VerifyGetDocumentStream(Integer)

Verifies that the requested document stream exists, and that we can access it, without actually getting the stream.
Returns: CRMScript.Global.Void