Class 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.
Syntax
Examples
NSDocumentAgent agent;
agent.callMethod(arg1, arg2);
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.
Declaration
Examples
NSDocumentAgent agent;
agent.callMethod(arg1, arg2);
Methods
CheckinDocument(Integer,String[],String,String[])
Checks in a currently checked-out document
Declaration
NSReturnInfo CheckinDocument(Integer documentId, String[] allowedReturnTypes, String versionDescription, String[] versionExtraFields)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
String versionDescription;
String[] versionExtraFields;
NSReturnInfo res = agent.CheckinDocument(documentId, allowedReturnTypes, versionDescription, versionExtraFields);
CheckoutDocument(Integer,String[])
Checks out a document for editing by the current user.
Declaration
NSReturnInfo CheckoutDocument(Integer documentId, String[] allowedReturnTypes)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
String[] |
allowedReturnTypes |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSReturnInfo res = agent.CheckoutDocument(documentId, allowedReturnTypes);
CreateDefaultDocumentEntity()
Sets default values into a new NSDocumentEntity.
Declaration
NSDocumentEntity CreateDefaultDocumentEntity()
Returns
Examples
NSDocumentAgent agent;
NSDocumentEntity thing = agent.CreateDefaultDocumentEntity();
thing = agent.SaveDocumentEntity(thing);
CreateDefaultDocumentEntityFromSuggestion(Integer)
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.
Declaration
NSDocumentEntity CreateDefaultDocumentEntityFromSuggestion(Integer suggestedDocumentId)
Parameters
Type |
Name |
Description |
Integer |
suggestedDocumentId |
|
Returns
Examples
NSDocumentAgent agent;
agent.callMethod(arg1, arg2);
CreateDefaultDocumentPreview()
Sets default values into a new NSDocumentPreview.
Declaration
NSDocumentPreview CreateDefaultDocumentPreview()
Returns
Examples
NSDocumentAgent agent;
NSDocumentPreview thing = agent.CreateDefaultDocumentPreview();
thing = agent.SaveDocumentPreview(thing);
CreateDefaultSuggestedDocumentEntity()
Sets default values into a new NSSuggestedDocumentEntity.
Declaration
NSSuggestedDocumentEntity CreateDefaultSuggestedDocumentEntity()
Returns
Examples
NSDocumentAgent agent;
NSSuggestedDocumentEntity thing = agent.CreateDefaultSuggestedDocumentEntity();
thing = agent.SaveSuggestedDocumentEntity(thing);
CreateDefaultTemplateVariablesParameters()
Sets default values into a new NSTemplateVariablesParameters.
Declaration
NSTemplateVariablesParameters CreateDefaultTemplateVariablesParameters()
Returns
Examples
NSDocumentAgent agent;
NSTemplateVariablesParameters thing = agent.CreateDefaultTemplateVariablesParameters();
thing = agent.SaveTemplateVariablesParameters(thing);
CreateDocumentStream(NSDocumentEntity,Bool)
Creates a new NSStream that can be used to store the document in the file archive.
Declaration
NSStream CreateDocumentStream(NSDocumentEntity documentEntity, Bool overwriteExistingData)
Parameters
Returns
Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
Bool overwriteExistingData;
NSStream res = agent.CreateDocumentStream(documentEntity, overwriteExistingData);
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.
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplate(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String uiCulture)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer contactId;
Integer personId;
Integer appointmentId;
Integer documentId;
Integer saleId;
Integer selectionId;
Integer projectId;
String uiCulture;
NSDocumentEntity res = agent.CreateNewPhysicalDocumentFromTemplate(contactId, personId, appointmentId, documentId, saleId, selectionId, projectId, uiCulture);
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.
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String[] customTags, String[] customValues, String uiCulture)
Parameters
Returns
NSDocumentAgent agent;
Integer contactId;
Integer personId;
Integer appointmentId;
Integer documentId;
Integer saleId;
Integer selectionId;
Integer projectId;
String[] customTags;
String[] customValues;
String uiCulture;
NSDocumentEntity res = agent.CreateNewPhysicalDocumentFromTemplateWithCustomTags(contactId, personId, appointmentId, documentId, saleId, selectionId, projectId, customTags, customValues, uiCulture);
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.
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags2(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, Map customTags, String uiCulture)
Parameters
Returns
NSDocumentAgent agent;
Integer contactId;
Integer personId;
Integer appointmentId;
Integer documentId;
Integer saleId;
Integer selectionId;
Integer projectId;
Map customTags;
String uiCulture;
NSDocumentEntity res = agent.CreateNewPhysicalDocumentFromTemplateWithCustomTags2(contactId, personId, appointmentId, documentId, saleId, selectionId, projectId, customTags, uiCulture);
CreateNewPhysicalMailMergeDocumentFromTemplate(Integer,String)
Creates a new physical document based on the documents template.
Declaration
NSDocumentEntity CreateNewPhysicalMailMergeDocumentFromTemplate(Integer documentId, String uiCulture)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String uiCulture;
NSDocumentEntity res = agent.CreateNewPhysicalMailMergeDocumentFromTemplate(documentId, uiCulture);
CreateTempFile(String)
Creates a new temporary file based on the provided stream. Specified filename may be overridden, and actual name is returned.
Declaration
String CreateTempFile(String filename, NSStream dataStream)
Parameters
Type |
Name |
Description |
String |
filename |
|
Returns
Examples
NSDocumentAgent agent;
String filename;
NSStream dataStream;
String res = agent.CreateTempFile(filename, dataStream);
DeleteDocumentEntity(Integer)
Deletes the NSDocumentEntity
Declaration
DeleteDocumentEntity(Integer documentEntity)
Parameters
Type |
Name |
Description |
Integer |
documentEntity |
|
Returns
Examples
NSDocumentAgent agent;
agent.DeleteDocumentEntity(123);
DeletePhysicalDocument(Integer,String[])
Deletes the document contents
Declaration
NSReturnInfo DeletePhysicalDocument(Integer documentId, String[] allowedReturnType)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
String[] |
allowedReturnType |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnType;
NSReturnInfo res = agent.DeletePhysicalDocument(documentId, allowedReturnType);
DeleteTempFile(String)
Deletes a temporary file created with CreateTempFile.
Declaration
Void DeleteTempFile(String filename)
Parameters
Type |
Name |
Description |
String |
filename |
|
Returns
Examples
NSDocumentAgent agent;
agent.callMethod(arg1, arg2);
ExecuteDocumentCommand(Integer,String,String[],String,String[])
Executes a custom command on a particular document, optionally a particular version
Declaration
NSReturnInfo ExecuteDocumentCommand(Integer documentId, String versionId, String[] allowedReturnTypes, String command, String[] additionalData)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String versionId;
String[] allowedReturnTypes;
String command;
String[] additionalData;
NSReturnInfo res = agent.ExecuteDocumentCommand(documentId, versionId, allowedReturnTypes, command, additionalData);
GetAppointmentDocuments(Integer)
Gets all documents that are linked to the appointment (the documents that are listed in the appointment dialog).
Declaration
NSDocument[] GetAppointmentDocuments(Integer appointmentId)
Parameters
Type |
Name |
Description |
Integer |
appointmentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer appointmentId;
NSDocument[] res = agent.GetAppointmentDocuments(appointmentId);
GetCheckoutState(Integer)
Gets the current checkout state for a document, relative to the user performing the call.
Declaration
NSCheckoutInfo GetCheckoutState(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSCheckoutInfo res = agent.GetCheckoutState(documentId);
Returns a specified number of document appointments within a time range.
Declaration
NSDocument[] GetContactDocuments(Integer contactId, DateTime startTime, DateTime endTime, Integer count)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the contact specified.
|
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetContactDocuments(contactId, startTime, endTime, count);
Returns a specified number of document appointments within a time range, filtered by the document template heading.
Declaration
NSDocument[] GetContactDocumentsByTemplateHeading(Integer contactId, DateTime startTime, DateTime endTime, Integer count, Integer templateHeadingId)
Parameters
Type |
Name |
Description |
Integer |
contactId |
|
Integer |
count |
|
Integer |
templateHeadingId |
The heading represents a grouping or filtering of document templates.
|
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the contact specified.
|
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetContactDocumentsByTemplateHeading(contactId, startTime, endTime, count, templateHeadingId);
Returns a specified number of document appointments within a time range, filtered by document template type.
Declaration
NSDocument[] GetContactDocumentsByTemplateType(Integer contactId, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the contact specified.
|
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetContactDocumentsByTemplateType(contactId, startTime, endTime, count, documentTemplateId);
Returns a specified number of document appointments within a time range, filtered by document template types.
Declaration
NSDocument[] GetContactDocumentsByTemplateTypes(Integer contactId, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the contact specified.
|
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer[] documentTemplateIds;
NSDocument[] res = agent.GetContactDocumentsByTemplateTypes(contactId, startTime, endTime, count, documentTemplateIds);
GetDocument(Integer)
Gets an NSDocument object.
Declaration
NSDocument GetDocument(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
NSDocument thing = agent.GetDocument(123);
GetDocumentCommands(Integer,String[])
Gets a list of custom commands valid for the specific document at this time.
Declaration
NSCommandInfo[] GetDocumentCommands(Integer documentId, String[] allowedReturnTypes)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
String[] |
allowedReturnTypes |
|
Returns
Remarks
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSCommandInfo[] res = agent.GetDocumentCommands(documentId, allowedReturnTypes);
GetDocumentEntity(Integer)
Gets an NSDocumentEntity object.
Declaration
NSDocumentEntity GetDocumentEntity(Integer documentEntityId)
Parameters
Type |
Name |
Description |
Integer |
documentEntityId |
|
Returns
Examples
NSDocumentAgent agent;
NSDocumentEntity thing = agent.GetDocumentEntity(123);
GetDocumentList(Integer[])
Gets an array of NSDocument objects.
Declaration
NSDocument[] GetDocumentList(Integer[] documentIds)
Parameters
Type |
Name |
Description |
Integer[] |
documentIds |
|
Returns
Examples
Integer[] ids;
NSDocumentAgent agent;
NSDocument[] docs = agent.GetDocumentList(ids);
GetDocumentProperties(Integer,String[])
Gets plugin-dependent properties for the document.
Declaration
Map GetDocumentProperties(Integer documentId, String[] requestedProperties)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
String[] |
requestedProperties |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String[] requestedProperties;
Map res = agent.GetDocumentProperties(documentId, requestedProperties);
GetDocumentsByTemplateHeading(Integer)
Returns document appointments, filtered by the document template heading.
Declaration
NSDocument[] GetDocumentsByTemplateHeading(Integer templateHeadingId)
Parameters
Type |
Name |
Description |
Integer |
templateHeadingId |
The heading represents a grouping or filtering of document templates.
|
Returns
Examples
NSDocumentAgent agent;
Integer templateHeadingId;
NSDocument[] res = agent.GetDocumentsByTemplateHeading(templateHeadingId);
GetDocumentStream(Integer)
Gets the document content as a stream
Declaration
NSStream GetDocumentStream(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSStream res = agent.GetDocumentStream(documentId);
GetDocumentStreamFromEntity(NSDocumentEntity)
Gets the document as a stream
Declaration
NSStream GetDocumentStreamFromEntity(NSDocumentEntity documentEntity)
Parameters
Returns
Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
NSStream res = agent.GetDocumentStreamFromEntity(documentEntity);
GetDocumentUrl(Integer,String,Bool)
Gets a URL referring to the given document content.
Declaration
String GetDocumentUrl(Integer documentId, String versionId, Bool writeableUrl)
Parameters
Returns
Type |
Description |
String |
The returned string is a fully qualified URL.
|
Examples
NSDocumentAgent agent;
Integer documentId;
String versionId;
Bool writeableUrl;
String res = agent.GetDocumentUrl(documentId, versionId, writeableUrl);
GetMyPublishedDocuments()
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.
Declaration
NSDocument[] GetMyPublishedDocuments()
Returns
Examples
NSDocumentAgent agent;
NSDocument[] res = agent.GetMyPublishedDocuments();
GetPersonDocuments(Integer)
Gets all documents that are linked to the person (the documents that are listed in the person dialog).
Declaration
NSDocument[] GetPersonDocuments(Integer personId)
Parameters
Type |
Name |
Description |
Integer |
personId |
|
Returns
Examples
NSDocumentAgent agent;
Integer personId;
NSDocument[] res = agent.GetPersonDocuments(personId);
GetPersonDocumentsByDate(Integer,Bool,Integer)
Returns a specified number of document appointments within a time range. The document appointments belong to the person specified.
Declaration
NSDocument[] GetPersonDocumentsByDate(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetPersonDocumentsByDate(personId, includeProjectDocuments, startTime, endTime, count);
GetPersonDocumentsByTemplateHeading(Integer,Bool,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by document template heading.
Declaration
NSDocument[] GetPersonDocumentsByTemplateHeading(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count, Integer templateHeadingId)
Parameters
Type |
Name |
Description |
Integer |
personId |
|
Bool |
includeProjectDocuments |
|
Integer |
count |
|
Integer |
templateHeadingId |
The heading represents a grouping or filtering of document templates.
|
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the person specified.
|
Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetPersonDocumentsByTemplateHeading(personId, includeProjectDocuments, startTime, endTime, count, templateHeadingId);
GetPersonDocumentsByTemplateType(Integer,Bool,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by document template type.
Declaration
NSDocument[] GetPersonDocumentsByTemplateType(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the person specified.
|
Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetPersonDocumentsByTemplateType(personId, includeProjectDocuments, startTime, endTime, count, documentTemplateId);
GetPersonDocumentsByTemplateTypes(Integer,Bool,Integer,Integer[])
Returns a specified number of document appointments within a time range, filtered by document template types.
Declaration
NSDocument[] GetPersonDocumentsByTemplateTypes(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the person specified.
|
Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
Integer[] documentTemplateIds;
NSDocument[] res = agent.GetPersonDocumentsByTemplateTypes(personId, includeProjectDocuments, startTime, endTime, count, documentTemplateIds);
GetPluginCapabilities(Integer)
Gets a list of plugin-dependent capabilities for a given document archive plugin.
Declaration
Map GetPluginCapabilities(Integer pluginId)
Parameters
Type |
Name |
Description |
Integer |
pluginId |
|
Returns
Type |
Description |
Map |
A standard set of properties is defined in SuperOffice.CRM.Documents.Constants.Capabilities.
|
Examples
NSDocumentAgent agent;
Integer pluginId;
Map res = agent.GetPluginCapabilities(pluginId);
GetPluginList()
Gets a list of installed document plugins
Declaration
Returns
Examples
NSDocumentAgent agent;
Map res = agent.GetPluginList();
GetPreviewDocumentStream(Integer)
Gets the preview version of the document content as a stream. Retrieves a sanitized version if possible
Declaration
NSDocumentPreview GetPreviewDocumentStream(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSDocumentPreview res = agent.GetPreviewDocumentStream(documentId);
GetProjectDocuments(Integer,Integer)
Returns a specified number of document appointments within a time range.
Declaration
NSDocument[] GetProjectDocuments(Integer projectId, DateTime startTime, DateTime endTime, Integer count)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the project specified.
|
Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetProjectDocuments(projectId, startTime, endTime, count);
GetProjectDocumentsByTemplateHeading(Integer,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by document template heading.
Declaration
NSDocument[] GetProjectDocumentsByTemplateHeading(Integer projectId, DateTime startTime, DateTime endTime, Integer count, Integer templateHeadingId)
Parameters
Type |
Name |
Description |
Integer |
projectId |
|
Integer |
count |
|
Integer |
templateHeadingId |
The heading represents a grouping or filtering of document templates.
|
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the project specified.
|
Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetProjectDocumentsByTemplateHeading(projectId, startTime, endTime, count, templateHeadingId);
GetProjectDocumentsByTemplateType(Integer,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by document template type.
Declaration
NSDocument[] GetProjectDocumentsByTemplateType(Integer projectId, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the project specified.
|
Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetProjectDocumentsByTemplateType(projectId, startTime, endTime, count, documentTemplateId);
GetProjectDocumentsByTemplateTypes(Integer,Integer,Integer[])
Returns a specified number of document appointments within a time range, filtered by document template types.
Declaration
NSDocument[] GetProjectDocumentsByTemplateTypes(Integer projectId, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer[] documentTemplateIds;
NSDocument[] res = agent.GetProjectDocumentsByTemplateTypes(projectId, startTime, endTime, count, documentTemplateIds);
GetProjectMemberDocuments(Integer,Integer)
Returns a specified number of document appointments within a time range.
Declaration
NSDocument[] GetProjectMemberDocuments(Integer personId, DateTime startTime, DateTime endTime, Integer count)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the project member specified.
|
Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetProjectMemberDocuments(personId, startTime, endTime, count);
GetProjectMemberDocumentsByTemplateHeading(Integer,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by document template heading.
Declaration
NSDocument[] GetProjectMemberDocumentsByTemplateHeading(Integer personId, DateTime startTime, DateTime endTime, Integer count, Integer templateHeadingId)
Parameters
Type |
Name |
Description |
Integer |
personId |
|
Integer |
count |
|
Integer |
templateHeadingId |
The heading represents a grouping or filtering of document templates.
|
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the project member specified.
|
Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetProjectMemberDocumentsByTemplateHeading(personId, startTime, endTime, count, templateHeadingId);
GetProjectMemberDocumentsByTemplateType(Integer,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by document template type.
Declaration
NSDocument[] GetProjectMemberDocumentsByTemplateType(Integer personId, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the project member specified.
|
Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetProjectMemberDocumentsByTemplateType(personId, startTime, endTime, count, documentTemplateId);
GetProjectMemberDocumentsByTemplateTypes(Integer,Integer,Integer[])
Returns a specified number of document appointments within a time range, filtered by document template types.
Declaration
NSDocument[] GetProjectMemberDocumentsByTemplateTypes(Integer personId, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the project member specified.
|
Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer[] documentTemplateIds;
NSDocument[] res = agent.GetProjectMemberDocumentsByTemplateTypes(personId, startTime, endTime, count, documentTemplateIds);
GetPublishedDocument(Integer)
Gets the document if it's published
Declaration
NSDocument GetPublishedDocument(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSDocument res = agent.GetPublishedDocument(documentId);
GetPublishedDocuments(Integer[])
Gets the published documents from an array of document IDs.
Declaration
NSDocument[] GetPublishedDocuments(Integer[] documentIds)
Parameters
Type |
Name |
Description |
Integer[] |
documentIds |
|
Returns
Examples
NSDocumentAgent agent;
Integer[] documentIds;
NSDocument[] res = agent.GetPublishedDocuments(documentIds);
GetPublishedDocumentsByDate(Integer,Bool,Integer)
Returns a specified number of published document appointments within a time range.
Declaration
NSDocument[] GetPublishedDocumentsByDate(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments is visible to the person specified or the document is in a project the person belongs to.
|
Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetPublishedDocumentsByDate(personId, includeProjectDocuments, startTime, endTime, count);
GetPublishedPersonDocumentsByDate(Integer,Bool,Integer)
Returns a specified number of published document appointments within a time range.
Declaration
NSDocument[] GetPublishedPersonDocumentsByDate(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count)
Parameters
Returns
Type |
Description |
NSDocument[] |
The document appointments belong to the person specified or the document is in a project the person belongs to.
|
Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetPublishedPersonDocumentsByDate(personId, includeProjectDocuments, startTime, endTime, count);
GetPublishedProjectDocuments(Integer)
Gets published appointment documents by project ID.
Declaration
NSDocument[] GetPublishedProjectDocuments(Integer projectId)
Parameters
Type |
Name |
Description |
Integer |
projectId |
|
Returns
Examples
NSDocumentAgent agent;
Integer projectId;
NSDocument[] res = agent.GetPublishedProjectDocuments(projectId);
GetSaleDocuments(Integer)
Gets all documents that are linked to the sale (the documents that are listed in the sale dialog).
Declaration
NSDocument[] GetSaleDocuments(Integer saleId)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Returns
Examples
NSDocumentAgent agent;
Integer saleId;
NSDocument[] res = agent.GetSaleDocuments(saleId);
GetSanitizedDocumentStream(Integer)
Gets the document content as a stream. Retrieves a sanitized version if possible
Declaration
NSStream GetSanitizedDocumentStream(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSStream res = agent.GetSanitizedDocumentStream(documentId);
GetSanitizedTemplateStream(String,Bool,String)
Retrieves a stream to a mail template based on its name. Sanitizes the contents if possible.
Declaration
NSStream GetSanitizedTemplateStream(String templateName, Bool allowPersonal, String uiCulture)
Parameters
Returns
Examples
NSDocumentAgent agent;
String templateName;
Bool allowPersonal;
String uiCulture;
NSStream res = agent.GetSanitizedTemplateStream(templateName, allowPersonal, uiCulture);
GetSanitizedTemplateStreamFromId(Integer,String)
Retrieve a stream to a document template based on its ID. Sanitizes the contents if possible.
Declaration
NSStream GetSanitizedTemplateStreamFromId(Integer templateId, String uiCulture)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer templateId;
String uiCulture;
NSStream res = agent.GetSanitizedTemplateStreamFromId(templateId, uiCulture);
GetSuggestedDocumentEntity(Integer)
Gets an NSSuggestedDocumentEntity object.
Declaration
NSSuggestedDocumentEntity GetSuggestedDocumentEntity(Integer suggestedDocumentEntityId)
Parameters
Type |
Name |
Description |
Integer |
suggestedDocumentEntityId |
|
Returns
Examples
NSDocumentAgent agent;
NSSuggestedDocumentEntity thing = agent.GetSuggestedDocumentEntity(123);
GetTempFile(String)
Gets data stream for temporary file created with CreateTempFile.
Declaration
NSStream GetTempFile(String filename)
Parameters
Type |
Name |
Description |
String |
filename |
|
Returns
Examples
NSDocumentAgent agent;
String filename;
NSStream res = agent.GetTempFile(filename);
GetTemplateStream(String,Bool,String)
Retrieve a stream to a mail template based on its name
Declaration
NSStream GetTemplateStream(String templateName, Bool allowPersonal, String uiCulture)
Parameters
Returns
Examples
NSDocumentAgent agent;
String templateName;
Bool allowPersonal;
String uiCulture;
NSStream res = agent.GetTemplateStream(templateName, allowPersonal, uiCulture);
GetTemplateStreamFromId(Integer,String)
Retrieve a stream to a document template based on its ID
Declaration
NSStream GetTemplateStreamFromId(Integer templateId, String uiCulture)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer templateId;
String uiCulture;
NSStream res = agent.GetTemplateStreamFromId(templateId, uiCulture);
GetUnsanitizedPreviewDocumentStream(Integer)
Gets the preview version of the document content as a stream. Retrieves an unsanitized version.
Declaration
NSDocumentPreview GetUnsanitizedPreviewDocumentStream(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSDocumentPreview res = agent.GetUnsanitizedPreviewDocumentStream(documentId);
GetVersionList(Integer)
Gets a list of existing, committed versions for a given document
Declaration
NSVersionInfo[] GetVersionList(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSVersionInfo[] res = agent.GetVersionList(documentId);
RenameDocument(Integer,String)
Rename the physical document (change the file name or equivalent concept in the document archive).
Declaration
String RenameDocument(Integer documentId, String newFilename)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String newFilename;
String res = agent.RenameDocument(documentId, newFilename);
SaveDocumentEntity(NSDocumentEntity)
Updates the existing NSDocumentEntity or creates a new NSDocumentEntity if the id parameter is 0
Declaration
NSDocumentEntity SaveDocumentEntity(NSDocumentEntity documentEntity)
Parameters
Type |
Name |
Description |
NSDocumentEntity |
documentEntity |
The NSDocumentEntity to save.
|
Returns
Examples
NSDocument agent;
NSDocumentEntity thing = agent.CreateDefaultDocumentEntity();
thing = agent.SaveDocumentEntity(thing);
SaveDocumentTemplateStream(Integer,NSStream,String,Integer)
Saves content in stream to document template file
Declaration
NSTemplateInfo SaveDocumentTemplateStream(Integer documentTemplateId, NSStream content, String languageCode, Integer pluginId)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer documentTemplateId;
NSStream content;
String languageCode;
Integer pluginId;
NSTemplateInfo res = agent.SaveDocumentTemplateStream(documentTemplateId, content, languageCode, pluginId);
SavePrivacyReport(String,String,Integer)
Generates a PDF from HTML and makes a document
Declaration
Integer SavePrivacyReport(String htmlReport, String title, Integer personId)
Parameters
Returns
Examples
NSDocumentAgent agent;
String htmlReport;
String title;
Integer personId;
Integer res = agent.SavePrivacyReport(htmlReport, title, personId);
SaveSuggestedDocumentEntity(NSSuggestedDocumentEntity)
Updates the existing NSSuggestedDocumentEntity or creates a new NSSuggestedDocumentEntity if the id parameter is 0
Declaration
NSSuggestedDocumentEntity SaveSuggestedDocumentEntity(NSSuggestedDocumentEntity suggestedDocumentEntity)
Parameters
Returns
Examples
NSDocument agent;
NSSuggestedDocumentEntity thing = agent.CreateDefaultSuggestedDocumentEntity();
thing = agent.SaveSuggestedDocumentEntity(thing);
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.
Declaration
NSDocumentEntity SetDocumentStream(NSDocumentEntity documentEntity, NSStream stream, Bool overwriteExistingData)
Parameters
Returns
Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
NSStream stream;
Bool overwriteExistingData;
NSDocumentEntity res = agent.SetDocumentStream(documentEntity, stream, overwriteExistingData);
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.
Declaration
NSDocumentEntity SetDocumentStreamFromId(Integer documentId, NSStream stream)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
NSStream stream;
NSDocumentEntity res = agent.SetDocumentStreamFromId(documentId, stream);
SetTemplateStream(String,Bool,NSStream)
Saves a mail signature template to the document archive
Declaration
Void SetTemplateStream(String filename, Bool personal, NSStream stream)
Parameters
Returns
Examples
NSDocumentAgent agent;
String filename;
Bool personal;
NSStream stream;
agent.SetTemplateStream(filename, personal, stream);
SubstituteMergeDocumentTemplateVariables(Integer,Integer,String[],String[])
Parses the source document, and replaces any template variable tags with their values, based on the associate ID.
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.
Declaration
NSStream SubstituteMergeDocumentTemplateVariables(Integer documentId, Integer associateId, String[] customTags, String[] customValues)
Parameters
Type |
Name |
Description |
Integer |
documentId |
The source document should be of type MergeDraft.
|
Integer |
associateId |
|
String[] |
customTags |
|
String[] |
customValues |
Custom values will override values otherwise set.
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
Integer associateId;
String[] customTags;
String[] customValues;
NSStream res = agent.SubstituteMergeDocumentTemplateVariables(documentId, associateId, customTags, customValues);
SubstituteMergeDocumentTemplateVariables2(Integer,Integer,Map)
Parses the source document, and replaces any template variable tags with their values, based on the associate ID.
Declaration
NSStream SubstituteMergeDocumentTemplateVariables2(Integer documentId, Integer associateId, Map customTags)
Parameters
Type |
Name |
Description |
Integer |
documentId |
The source document should be of type MergeDraft.
|
Integer |
associateId |
|
Map |
customTags |
These tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
Integer associateId;
Map customTags;
NSStream res = agent.SubstituteMergeDocumentTemplateVariables2(documentId, associateId, customTags);
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
Declaration
NSStream SubstituteMergeDocumentTemplateVariablesEx(Integer mergeDocumentId, Integer contactId, Integer personId, Integer projectId, Integer selectionId, Integer appointmentId, Integer documentId, Integer saleId, String[] customTags, String[] customValues)
Parameters
Returns
Examples
NSDocumentAgent agent;
Integer mergeDocumentId;
Integer contactId;
Integer personId;
Integer projectId;
Integer selectionId;
Integer appointmentId;
Integer documentId;
Integer saleId;
String[] customTags;
String[] customValues;
NSStream res = agent.SubstituteMergeDocumentTemplateVariablesEx(mergeDocumentId, contactId, personId, projectId, selectionId, appointmentId, documentId, saleId, customTags, customValues);
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.
Declaration
NSStream SubstituteMergeDocumentTemplateVariablesEx2(Integer mergeDocumentId, Integer contactId, Integer personId, Integer projectId, Integer selectionId, Integer appointmentId, Integer documentId, Integer saleId, Map customTags)
Parameters
Type |
Name |
Description |
Integer |
mergeDocumentId |
The source document should be of type MergeDraft.
|
Integer |
contactId |
|
Integer |
personId |
|
Integer |
projectId |
|
Integer |
selectionId |
|
Integer |
appointmentId |
|
Integer |
documentId |
|
Integer |
saleId |
|
Map |
customTags |
These tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.
|
Returns
Examples
NSDocumentAgent agent;
Integer mergeDocumentId;
Integer contactId;
Integer personId;
Integer projectId;
Integer selectionId;
Integer appointmentId;
Integer documentId;
Integer saleId;
Map customTags;
NSStream res = agent.SubstituteMergeDocumentTemplateVariablesEx2(mergeDocumentId, contactId, personId, projectId, selectionId, appointmentId, documentId, saleId, customTags);
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.
Declaration
String SubstituteTemplateVariables(String source, Integer generatorEncoding, Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String cultureName)
Parameters
Returns
Examples
NSDocumentAgent agent;
String source;
Integer generatorEncoding;
Integer contactId;
Integer personId;
Integer appointmentId;
Integer documentId;
Integer saleId;
Integer selectionId;
Integer projectId;
String cultureName;
String res = agent.SubstituteTemplateVariables(source, generatorEncoding, contactId, personId, appointmentId, documentId, saleId, selectionId, projectId, cultureName);
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.
Declaration
String SubstituteTemplateVariablesEx(NSTemplateVariablesParameters parameters)
Returns
Examples
NSDocumentAgent agent;
NSTemplateVariablesParameters parameters;
String res = agent.SubstituteTemplateVariablesEx(parameters);
Parse the source string, and replace any template variable tags with their values, based on the IDs given in the other parameters.
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.
Declaration
String SubstituteTemplateVariablesWithCustomTags(String source, Integer generatorEncoding, String[] customTags, String[] customValues, Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String cultureName)
Parameters
Returns
NSDocumentAgent agent;
String source;
Integer generatorEncoding;
String[] customTags;
String[] customValues;
Integer contactId;
Integer personId;
Integer appointmentId;
Integer documentId;
Integer saleId;
Integer selectionId;
Integer projectId;
String cultureName;
String res = agent.SubstituteTemplateVariablesWithCustomTags(source, generatorEncoding, customTags, customValues, contactId, personId, appointmentId, documentId, saleId, selectionId, projectId, cultureName);
Parse the source string, and replace any template variable tags with their values, based on the IDs given in the other parameters.
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.
Declaration
String SubstituteTemplateVariablesWithCustomTags2(String source, Integer generatorEncoding, Map customTags, Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String cultureName)
Parameters
Returns
NSDocumentAgent agent;
String source;
Integer generatorEncoding;
Map customTags;
Integer contactId;
Integer personId;
Integer appointmentId;
Integer documentId;
Integer saleId;
Integer selectionId;
Integer projectId;
String cultureName;
String res = agent.SubstituteTemplateVariablesWithCustomTags2(source, generatorEncoding, customTags, contactId, personId, appointmentId, documentId, saleId, selectionId, projectId, cultureName);
UndoCheckoutDocument(Integer,String[])
Undoes (abandon) a checkout
Declaration
NSReturnInfo UndoCheckoutDocument(Integer documentId, String[] allowedReturnTypes)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
String[] |
allowedReturnTypes |
|
Returns
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSReturnInfo res = agent.UndoCheckoutDocument(documentId, allowedReturnTypes);
ValidateDocumentEntity(NSDocumentEntity)
Checks that entity is ready for saving, return error messages by field.
Declaration
Map ValidateDocumentEntity(NSDocumentEntity documentEntity)
Parameters
Returns
Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
Map res = agent.ValidateDocumentEntity(documentEntity);
VerifyGetDocumentStream(Integer)
Verifies that the requested document stream exists, and that we can access it, without actually getting the stream.
Declaration
Void VerifyGetDocumentStream(Integer documentId)
Parameters
Type |
Name |
Description |
Integer |
documentId |
|
Returns
Examples
NSDocumentAgent agent;
agent.callMethod(arg1, arg2);