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.
Introduced or updated in version: 7
Declaration
NSDocumentAgent
Examples
NSDocumentAgent agent;
agent.callMethod(arg1, arg2);
Methods
CheckinDocument(Integer,String[],String,String[])
Checks in a currently checked-out document
Introduced or updated in version: 7
Declaration
NSReturnInfo CheckinDocument(Integer documentId, String[] allowedReturnTypes, String versionDescription, String[] versionExtraFields)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String[] | allowedReturnTypes | |
String | versionDescription | |
String[] | versionExtraFields |
Returns
Type | Description |
---|---|
NSReturnInfo |
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.
Introduced or updated in version: 7
Declaration
NSReturnInfo CheckoutDocument(Integer documentId, String[] allowedReturnTypes)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String[] | allowedReturnTypes |
Returns
Type | Description |
---|---|
NSReturnInfo |
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSReturnInfo res = agent.CheckoutDocument(documentId, allowedReturnTypes);
CreateDefaultDocumentEntity()
Sets default values into a new NSDocumentEntity.
Introduced or updated in version: 7
Declaration
NSDocumentEntity CreateDefaultDocumentEntity()
Returns
Type | Description |
---|---|
NSDocumentEntity | The new entity with default values. |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSDocumentAgent agent;
NSDocumentEntity thing = agent.CreateDefaultDocumentEntity();
thing = agent.SaveDocumentEntity(thing);
CreateDefaultDocumentEntityFromSuggestion(Integer)
Introduced or updated in version: 7
Declaration
NSDocumentEntity CreateDefaultDocumentEntityFromSuggestion(Integer suggestedDocumentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | suggestedDocumentId |
Returns
Type | Description |
---|---|
NSDocumentEntity | The new entity. |
CreateDefaultDocumentPreview()
Sets default values into a new NSDocumentPreview.
Introduced or updated in version: 7
Declaration
NSDocumentPreview CreateDefaultDocumentPreview()
Returns
Type | Description |
---|---|
NSDocumentPreview |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSDocumentAgent agent;
NSDocumentPreview thing = agent.CreateDefaultDocumentPreview();
thing = agent.SaveDocumentPreview(thing);
CreateDefaultSuggestedDocumentEntity()
Sets default values into a new NSSuggestedDocumentEntity.
Introduced or updated in version: 7.5
Declaration
NSSuggestedDocumentEntity CreateDefaultSuggestedDocumentEntity()
Returns
Type | Description |
---|---|
NSSuggestedDocumentEntity | The new entity. |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSDocumentAgent agent;
NSSuggestedDocumentEntity thing = agent.CreateDefaultSuggestedDocumentEntity();
thing = agent.SaveSuggestedDocumentEntity(thing);
CreateDefaultTemplateVariablesParameters()
Sets default values into a new NSTemplateVariablesParameters.
Introduced or updated in version: 7
Declaration
NSTemplateVariablesParameters CreateDefaultTemplateVariablesParameters()
Returns
Type | Description |
---|---|
NSTemplateVariablesParameters |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
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.
Introduced or updated in version: 7
Declaration
NSStream CreateDocumentStream(NSDocumentEntity documentEntity, Bool overwriteExistingData)
Parameters
Type | Name | Description |
---|---|---|
NSDocumentEntity | documentEntity | |
Bool | overwriteExistingData |
Returns
Type | Description |
---|---|
NSStream |
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.
Introduced or updated in version: 7
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplate(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | |
Integer | personId | |
Integer | appointmentId | |
Integer | documentId | |
Integer | saleId | |
Integer | selectionId | |
Integer | projectId | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Remarks
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.
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);
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.
Introduced or updated in version: 7
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String[] customTags, String[] customValues, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | |
Integer | personId | |
Integer | appointmentId | |
Integer | documentId | |
Integer | saleId | |
Integer | selectionId | |
Integer | projectId | |
String[] | customTags | |
String[] | customValues | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Remarks
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.
Examples
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);
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.
Introduced or updated in version: 7
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags2(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, Map customTags, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | |
Integer | personId | |
Integer | appointmentId | |
Integer | documentId | |
Integer | saleId | |
Integer | selectionId | |
Integer | projectId | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Remarks
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.
Examples
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.
Introduced or updated in version: 7
Declaration
NSDocumentEntity CreateNewPhysicalMailMergeDocumentFromTemplate(Integer documentId, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Remarks
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.
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.
Introduced or updated in version: 7
Declaration
String CreateTempFile(String filename, NSStream dataStream)
Parameters
Type | Name | Description |
---|---|---|
String | filename |
Returns
Type | Description |
---|---|
String |
Examples
NSDocumentAgent agent;
String filename;
NSStream dataStream;
String res = agent.CreateTempFile(filename, dataStream);
DeleteDocumentEntity(Integer)
Deletes the NSDocumentEntity
Introduced or updated in version: 7
Declaration
DeleteDocumentEntity(Integer documentEntity)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentEntity |
Returns
Type | Description |
---|---|
Void |
Examples
NSDocumentAgent agent;
agent.DeleteDocumentEntity(123);
DeletePhysicalDocument(Integer,String[])
Deletes the document contents
Introduced or updated in version: 7
Declaration
NSReturnInfo DeletePhysicalDocument(Integer documentId, String[] allowedReturnType)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String[] | allowedReturnType |
Returns
Type | Description |
---|---|
NSReturnInfo |
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnType;
NSReturnInfo res = agent.DeletePhysicalDocument(documentId, allowedReturnType);
DeleteTempFile(String)
Deletes a temporary file created with CreateTempFile.
Introduced or updated in version: 7
Declaration
Void DeleteTempFile(String filename)
Parameters
Type | Name | Description |
---|---|---|
String | filename |
Returns
Type | Description |
---|---|
Void |
ExecuteDocumentCommand(Integer,String,String[],String,String[])
Executes a custom command on a particular document, optionally a particular version
Introduced or updated in version: 7
Declaration
NSReturnInfo ExecuteDocumentCommand(Integer documentId, String versionId, String[] allowedReturnTypes, String command, String[] additionalData)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String | versionId | |
String[] | allowedReturnTypes | |
String | command | |
String[] | additionalData |
Returns
Type | Description |
---|---|
NSReturnInfo |
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).
Introduced or updated in version: 7
Declaration
NSDocument[] GetAppointmentDocuments(Integer appointmentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | appointmentId |
Returns
Type | Description |
---|---|
NSDocument[] |
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.
Introduced or updated in version: 7
Declaration
NSCheckoutInfo GetCheckoutState(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSCheckoutInfo |
Examples
NSDocumentAgent agent;
Integer documentId;
NSCheckoutInfo res = agent.GetCheckoutState(documentId);
GetContactDocuments(Integer,Integer)
Returns a specified number of document appointments within a time range.
Introduced or updated in version: 7
Declaration
NSDocument[] GetContactDocuments(Integer contactId, DateTime startTime, DateTime endTime, Integer count)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | |
Integer | count |
Returns
Type | Description |
---|---|
NSDocument[] | The document appointments belong to the contact specified. |
Examples
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetContactDocuments(contactId, startTime, endTime, count);
GetContactDocumentsByTemplateHeading(Integer,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by the document template heading.
Introduced or updated in version: 7
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. |
Examples
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetContactDocumentsByTemplateHeading(contactId, startTime, endTime, count, templateHeadingId);
GetContactDocumentsByTemplateType(Integer,Integer,Integer)
Returns a specified number of document appointments within a time range, filtered by document template type.
Introduced or updated in version: 7
Declaration
NSDocument[] GetContactDocumentsByTemplateType(Integer contactId, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | |
Integer | count | |
Integer | documentTemplateId |
Returns
Type | Description |
---|---|
NSDocument[] | The document appointments belong to the contact specified. |
Examples
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetContactDocumentsByTemplateType(contactId, startTime, endTime, count, documentTemplateId);
GetContactDocumentsByTemplateTypes(Integer,Integer,Integer[])
Returns a specified number of document appointments within a time range, filtered by document template types.
Introduced or updated in version: 7
Declaration
NSDocument[] GetContactDocumentsByTemplateTypes(Integer contactId, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | |
Integer | count | |
Integer[] | documentTemplateIds |
Returns
Type | Description |
---|---|
NSDocument[] | The document appointments belong to the contact specified. |
Examples
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.
Introduced or updated in version: 7
Declaration
NSDocument GetDocument(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSDocument |
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.
Introduced or updated in version: 7
Declaration
NSCommandInfo[] GetDocumentCommands(Integer documentId, String[] allowedReturnTypes)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String[] | allowedReturnTypes |
Returns
Type | Description |
---|---|
NSCommandInfo[] |
Remarks
This information should not be cached by clients, as it may change between documents and over time.
Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSCommandInfo[] res = agent.GetDocumentCommands(documentId, allowedReturnTypes);
GetDocumentEntity(Integer)
Gets an NSDocumentEntity object.
Introduced or updated in version: 7
Declaration
NSDocumentEntity GetDocumentEntity(Integer documentEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentEntityId |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Examples
NSDocumentAgent agent;
NSDocumentEntity thing = agent.GetDocumentEntity(123);
GetDocumentList(Integer[])
Gets an array of NSDocument objects.
Introduced or updated in version: 7
Declaration
NSDocument[] GetDocumentList(Integer[] documentIds)
Parameters
Type | Name | Description |
---|---|---|
Integer[] | documentIds |
Returns
Type | Description |
---|---|
NSDocument[] |
Examples
Integer[] ids;
NSDocumentAgent agent;
NSDocument[] docs = agent.GetDocumentList(ids);
GetDocumentProperties(Integer,String[])
Gets plugin-dependent properties for the document.
Introduced or updated in version: 7.5
Declaration
Map GetDocumentProperties(Integer documentId, String[] requestedProperties)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String[] | requestedProperties |
Returns
Type | Description |
---|---|
Map |
Remarks
A number of standard properties that should be supported by all plugins are defined in SuperOffice.CRM.Documents.Constants.Properties.
Examples
NSDocumentAgent agent;
Integer documentId;
String[] requestedProperties;
Map res = agent.GetDocumentProperties(documentId, requestedProperties);
GetDocumentsByTemplateHeading(Integer)
Returns document appointments, filtered by the document template heading.
Introduced or updated in version: 7
Declaration
NSDocument[] GetDocumentsByTemplateHeading(Integer templateHeadingId)
Parameters
Type | Name | Description |
---|---|---|
Integer | templateHeadingId | The heading represents a grouping or filtering of document templates. |
Returns
Type | Description |
---|---|
NSDocument[] |
Examples
NSDocumentAgent agent;
Integer templateHeadingId;
NSDocument[] res = agent.GetDocumentsByTemplateHeading(templateHeadingId);
GetDocumentStream(Integer)
Gets the document content as a stream
Introduced or updated in version: 7
Declaration
NSStream GetDocumentStream(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSStream |
Examples
NSDocumentAgent agent;
Integer documentId;
NSStream res = agent.GetDocumentStream(documentId);
GetDocumentStreamFromEntity(NSDocumentEntity)
Gets the document as a stream
Introduced or updated in version: 7
Declaration
NSStream GetDocumentStreamFromEntity(NSDocumentEntity documentEntity)
Parameters
Type | Name | Description |
---|---|---|
NSDocumentEntity | documentEntity |
Returns
Type | Description |
---|---|
NSStream |
Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
NSStream res = agent.GetDocumentStreamFromEntity(documentEntity);
GetDocumentUrl(Integer,String,Bool)
Gets a URL referring to the given document content.
Introduced or updated in version: 7
Declaration
String GetDocumentUrl(Integer documentId, String versionId, Bool writeableUrl)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String | versionId | |
Bool | writeableUrl |
Returns
Type | Description |
---|---|
String | The returned string is a fully qualified URL. |
Remarks
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.
Examples
NSDocumentAgent agent;
Integer documentId;
String versionId;
Bool writeableUrl;
String res = agent.GetDocumentUrl(documentId, versionId, writeableUrl);
GetMyPublishedDocuments()
Introduced or updated in version: 7
Declaration
NSDocument[] GetMyPublishedDocuments()
Returns
Type | Description |
---|---|
NSDocument[] |
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).
Introduced or updated in version: 7
Declaration
NSDocument[] GetPersonDocuments(Integer personId)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId |
Returns
Type | Description |
---|---|
NSDocument[] |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetPersonDocumentsByDate(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Bool | includeProjectDocuments | |
Integer | count |
Returns
Type | Description |
---|---|
NSDocument[] |
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.
Introduced or updated in version: 7
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetPersonDocumentsByTemplateType(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Bool | includeProjectDocuments | |
Integer | count | |
Integer | documentTemplateId |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetPersonDocumentsByTemplateTypes(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Bool | includeProjectDocuments | |
Integer | count | |
Integer[] | documentTemplateIds |
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.
Introduced or updated in version: 7.5
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
Introduced or updated in version: 8.2
Declaration
Map GetPluginList()
Returns
Type | Description |
---|---|
Map |
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
Introduced or updated in version: 7
Declaration
NSDocumentPreview GetPreviewDocumentStream(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSDocumentPreview |
Examples
NSDocumentAgent agent;
Integer documentId;
NSDocumentPreview res = agent.GetPreviewDocumentStream(documentId);
GetProjectDocuments(Integer,Integer)
Returns a specified number of document appointments within a time range.
Introduced or updated in version: 7
Declaration
NSDocument[] GetProjectDocuments(Integer projectId, DateTime startTime, DateTime endTime, Integer count)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | |
Integer | count |
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.
Introduced or updated in version: 7
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetProjectDocumentsByTemplateType(Integer projectId, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | |
Integer | count | |
Integer | documentTemplateId |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetProjectDocumentsByTemplateTypes(Integer projectId, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | |
Integer | count | |
Integer[] | documentTemplateIds |
Returns
Type | Description |
---|---|
NSDocument[] |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetProjectMemberDocuments(Integer personId, DateTime startTime, DateTime endTime, Integer count)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Integer | count |
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.
Introduced or updated in version: 7
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetProjectMemberDocumentsByTemplateType(Integer personId, DateTime startTime, DateTime endTime, Integer count, Integer documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Integer | count | |
Integer | documentTemplateId |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetProjectMemberDocumentsByTemplateTypes(Integer personId, DateTime startTime, DateTime endTime, Integer count, Integer[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Integer | count | |
Integer[] | documentTemplateIds |
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
Introduced or updated in version: 7
Declaration
NSDocument GetPublishedDocument(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSDocument |
Examples
NSDocumentAgent agent;
Integer documentId;
NSDocument res = agent.GetPublishedDocument(documentId);
GetPublishedDocuments(Integer[])
Gets the published documents from an array of document IDs.
Introduced or updated in version: 7
Declaration
NSDocument[] GetPublishedDocuments(Integer[] documentIds)
Parameters
Type | Name | Description |
---|---|---|
Integer[] | documentIds |
Returns
Type | Description |
---|---|
NSDocument[] |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetPublishedDocumentsByDate(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Bool | includeProjectDocuments | |
Integer | count |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetPublishedPersonDocumentsByDate(Integer personId, Bool includeProjectDocuments, DateTime startTime, DateTime endTime, Integer count)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | |
Bool | includeProjectDocuments | |
Integer | count |
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.
Introduced or updated in version: 7
Declaration
NSDocument[] GetPublishedProjectDocuments(Integer projectId)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId |
Returns
Type | Description |
---|---|
NSDocument[] |
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).
Introduced or updated in version: 7
Declaration
NSDocument[] GetSaleDocuments(Integer saleId)
Parameters
Type | Name | Description |
---|---|---|
Integer | saleId |
Returns
Type | Description |
---|---|
NSDocument[] |
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
Introduced or updated in version: 8.5R08
Declaration
NSStream GetSanitizedDocumentStream(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSStream |
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.
Introduced or updated in version: 8.5R08
Declaration
NSStream GetSanitizedTemplateStream(String templateName, Bool allowPersonal, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
String | templateName | |
Bool | allowPersonal | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSStream |
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.
Introduced or updated in version: 8.5R08
Declaration
NSStream GetSanitizedTemplateStreamFromId(Integer templateId, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Integer | templateId | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSStream |
Examples
NSDocumentAgent agent;
Integer templateId;
String uiCulture;
NSStream res = agent.GetSanitizedTemplateStreamFromId(templateId, uiCulture);
GetSuggestedDocumentEntity(Integer)
Gets an NSSuggestedDocumentEntity object.
Introduced or updated in version: 7.5
Declaration
NSSuggestedDocumentEntity GetSuggestedDocumentEntity(Integer suggestedDocumentEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | suggestedDocumentEntityId |
Returns
Type | Description |
---|---|
NSSuggestedDocumentEntity |
Examples
NSDocumentAgent agent;
NSSuggestedDocumentEntity thing = agent.GetSuggestedDocumentEntity(123);
GetTempFile(String)
Gets data stream for temporary file created with CreateTempFile.
Introduced or updated in version: 7
Declaration
NSStream GetTempFile(String filename)
Parameters
Type | Name | Description |
---|---|---|
String | filename |
Returns
Type | Description |
---|---|
NSStream |
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
Introduced or updated in version: 7
Declaration
NSStream GetTemplateStream(String templateName, Bool allowPersonal, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
String | templateName | |
Bool | allowPersonal | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSStream |
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
Introduced or updated in version: 7.5
Declaration
NSStream GetTemplateStreamFromId(Integer templateId, String uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Integer | templateId | |
String | uiCulture |
Returns
Type | Description |
---|---|
NSStream |
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.
Introduced or updated in version: 7
Declaration
NSDocumentPreview GetUnsanitizedPreviewDocumentStream(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSDocumentPreview |
Remarks
This has less CPU impact but the caller must sanitize the content before presenting it to the user.
Examples
NSDocumentAgent agent;
Integer documentId;
NSDocumentPreview res = agent.GetUnsanitizedPreviewDocumentStream(documentId);
GetVersionList(Integer)
Gets a list of existing, committed versions for a given document
Introduced or updated in version: 7
Declaration
NSVersionInfo[] GetVersionList(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSVersionInfo[] |
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).
Introduced or updated in version: 7
Declaration
String RenameDocument(Integer documentId, String newFilename)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String | newFilename |
Returns
Type | Description |
---|---|
String |
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
Introduced or updated in version: 7
Declaration
NSDocumentEntity SaveDocumentEntity(NSDocumentEntity documentEntity)
Parameters
Type | Name | Description |
---|---|---|
NSDocumentEntity | documentEntity | The NSDocumentEntity to save. |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Examples
NSDocument agent;
NSDocumentEntity thing = agent.CreateDefaultDocumentEntity();
thing = agent.SaveDocumentEntity(thing);
SaveDocumentTemplateStream(Integer,NSStream,String,Integer)
Saves content in stream to document template file
Introduced or updated in version: 7.5
Declaration
NSTemplateInfo SaveDocumentTemplateStream(Integer documentTemplateId, NSStream content, String languageCode, Integer pluginId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentTemplateId | |
NSStream | content | |
String | languageCode | |
Integer | pluginId |
Returns
Type | Description |
---|---|
NSTemplateInfo |
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
Introduced or updated in version: 8.5R08
Declaration
Integer SavePrivacyReport(String htmlReport, String title, Integer personId)
Parameters
Type | Name | Description |
---|---|---|
String | htmlReport | |
String | title | |
Integer | personId |
Returns
Type | Description |
---|---|
Integer |
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
Introduced or updated in version: 7.5
Declaration
NSSuggestedDocumentEntity SaveSuggestedDocumentEntity(NSSuggestedDocumentEntity suggestedDocumentEntity)
Parameters
Type | Name | Description |
---|---|---|
NSSuggestedDocumentEntity | suggestedDocumentEntity | The NSSuggestedDocumentEntity to save. |
Returns
Type | Description |
---|---|
NSSuggestedDocumentEntity |
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.
Introduced or updated in version: 7
Declaration
NSDocumentEntity SetDocumentStream(NSDocumentEntity documentEntity, NSStream stream, Bool overwriteExistingData)
Parameters
Type | Name | Description |
---|---|---|
NSDocumentEntity | documentEntity | |
Bool | overwriteExistingData |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Remarks
The client should not assume that any earlier, cached entity information is valid.
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.
Introduced or updated in version: 7
Declaration
NSDocumentEntity SetDocumentStreamFromId(Integer documentId, NSStream stream)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
NSDocumentEntity |
Remarks
The client should not assume that any earlier, cached entity information is valid.
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
Introduced or updated in version: 7
Declaration
Void SetTemplateStream(String filename, Bool personal, NSStream stream)
Parameters
Type | Name | Description |
---|---|---|
String | filename | |
Bool | personal | |
NSStream | stream |
Returns
Type | Description |
---|---|
Void |
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.
Introduced or updated in version: 7
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
Type | Description |
---|---|
NSStream |
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.
Introduced or updated in version: 7
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
Type | Description |
---|---|
NSStream |
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
Introduced or updated in version: 7
Declaration
NSStream SubstituteMergeDocumentTemplateVariablesEx(Integer mergeDocumentId, Integer contactId, Integer personId, Integer projectId, Integer selectionId, Integer appointmentId, Integer documentId, Integer saleId, String[] customTags, String[] customValues)
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 | |
String[] | customTags | |
String[] | customValues | Custom values will override values otherwise set. |
Returns
Type | Description |
---|---|
NSStream |
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.
Introduced or updated in version: 7
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
Type | Description |
---|---|
NSStream |
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.
Introduced or updated in version: 7
Declaration
String SubstituteTemplateVariables(String source, Integer generatorEncoding, Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String cultureName)
Parameters
Type | Name | Description |
---|---|---|
String | source | |
Integer | generatorEncoding | |
Integer | contactId | |
Integer | personId | |
Integer | appointmentId | |
Integer | documentId | |
Integer | saleId | |
Integer | selectionId | |
Integer | projectId | |
String | cultureName |
Returns
Type | Description |
---|---|
String |
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.
Introduced or updated in version: 7
Declaration
String SubstituteTemplateVariablesEx(NSTemplateVariablesParameters parameters)
Returns
Type | Description |
---|---|
String |
Examples
NSDocumentAgent agent;
NSTemplateVariablesParameters parameters;
String res = agent.SubstituteTemplateVariablesEx(parameters);
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.
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.
Introduced or updated in version: 7
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
Type | Name | Description |
---|---|---|
String | source | |
Integer | generatorEncoding | |
String[] | customTags | |
String[] | customValues | |
Integer | contactId | |
Integer | personId | |
Integer | appointmentId | |
Integer | documentId | |
Integer | saleId | |
Integer | selectionId | |
Integer | projectId | |
String | cultureName |
Returns
Type | Description |
---|---|
String |
Examples
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);
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.
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.
Introduced or updated in version: 7
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
Type | Name | Description |
---|---|---|
String | source | |
Integer | generatorEncoding | |
Map | customTags | |
Integer | contactId | |
Integer | personId | |
Integer | appointmentId | |
Integer | documentId | |
Integer | saleId | |
Integer | selectionId | |
Integer | projectId | |
String | cultureName |
Returns
Type | Description |
---|---|
String |
Examples
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
Introduced or updated in version: 7
Declaration
NSReturnInfo UndoCheckoutDocument(Integer documentId, String[] allowedReturnTypes)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId | |
String[] | allowedReturnTypes |
Returns
Type | Description |
---|---|
NSReturnInfo |
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.
Introduced or updated in version: 7
Declaration
Map ValidateDocumentEntity(NSDocumentEntity documentEntity)
Parameters
Type | Name | Description |
---|---|---|
NSDocumentEntity | documentEntity |
Returns
Type | Description |
---|---|
Map |
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.
Introduced or updated in version: 7
Declaration
Void VerifyGetDocumentStream(Integer documentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | documentId |
Returns
Type | Description |
---|---|
Void |