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.
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
NSDocumentAgent 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) Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
String versionDescription;
String[] versionExtraFields;
NSReturnInfo res = agent.CheckinDocument(documentId, allowedReturnTypes, versionDescription, versionExtraFields);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String[] | allowedReturnTypes | |
| String | versionDescription | |
| String[] | versionExtraFields |
Returns
| Type | Description |
| NSReturnInfo |
CheckoutDocument(Integer,String[])
Checks out a document for editing by the current user.
Declaration
NSReturnInfo CheckoutDocument(Integer documentId, String[] allowedReturnTypes) Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSReturnInfo res = agent.CheckoutDocument(documentId, allowedReturnTypes);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String[] | allowedReturnTypes |
Returns
| Type | Description |
| NSReturnInfo |
CreateDefaultDocumentEntity()
Sets default values into a new NSDocumentEntity.
Declaration
NSDocumentEntity CreateDefaultDocumentEntity() Examples
NSDocumentAgent agent;
NSDocumentEntity thing = agent.CreateDefaultDocumentEntity();
thing = agent.SaveDocumentEntity(thing);
Returns
| Type | Description |
| NSDocumentEntity | The new entity with default values. |
CreateDefaultDocumentEntityFromSuggestion(Integer)
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.
Declaration
NSDocumentPreview CreateDefaultDocumentPreview() Examples
NSDocumentAgent agent;
NSDocumentPreview thing = agent.CreateDefaultDocumentPreview();
thing = agent.SaveDocumentPreview(thing);
Returns
| Type | Description |
| NSDocumentPreview |
CreateDefaultSuggestedDocumentEntity()
Sets default values into a new NSSuggestedDocumentEntity.
Declaration
NSSuggestedDocumentEntity CreateDefaultSuggestedDocumentEntity() Examples
NSDocumentAgent agent;
NSSuggestedDocumentEntity thing = agent.CreateDefaultSuggestedDocumentEntity();
thing = agent.SaveSuggestedDocumentEntity(thing);
Returns
| Type | Description |
| NSSuggestedDocumentEntity | The new entity. |
CreateDefaultTemplateVariablesParameters()
Sets default values into a new NSTemplateVariablesParameters.
Declaration
NSTemplateVariablesParameters CreateDefaultTemplateVariablesParameters() Examples
NSDocumentAgent agent;
NSTemplateVariablesParameters thing = agent.CreateDefaultTemplateVariablesParameters();
thing = agent.SaveTemplateVariablesParameters(thing);
Returns
| Type | Description |
| NSTemplateVariablesParameters |
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) Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
Bool overwriteExistingData;
NSStream res = agent.CreateDocumentStream(documentEntity, overwriteExistingData);
Parameters
| Type | Name | Description |
| NSDocumentEntity | documentEntity | |
| Bool | overwriteExistingData |
Returns
| Type | Description |
| NSStream |
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) 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);
Parameters
| Type | Name | Description |
| Integer | contactId | |
| Integer | personId | |
| Integer | appointmentId | |
| Integer | documentId | |
| Integer | saleId | |
| Integer | selectionId | |
| Integer | projectId | |
| String | uiCulture |
Returns
| Type | Description |
| NSDocumentEntity |
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.
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, String[] customTags, String[] customValues, String uiCulture) 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);
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 |
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.
Declaration
NSDocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags2(Integer contactId, Integer personId, Integer appointmentId, Integer documentId, Integer saleId, Integer selectionId, Integer projectId, Map customTags, String uiCulture) 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);
Parameters
| Type | Name | Description |
| Integer | contactId | |
| Integer | personId | |
| Integer | appointmentId | |
| Integer | documentId | |
| Integer | saleId | |
| Integer | selectionId | |
| Integer | projectId | |
| String | uiCulture |
Returns
| Type | Description |
| NSDocumentEntity |
CreateNewPhysicalMailMergeDocumentFromTemplate(Integer,String)
Creates a new physical document based on the documents template.
Declaration
NSDocumentEntity CreateNewPhysicalMailMergeDocumentFromTemplate(Integer documentId, String uiCulture) Examples
NSDocumentAgent agent;
Integer documentId;
String uiCulture;
NSDocumentEntity res = agent.CreateNewPhysicalMailMergeDocumentFromTemplate(documentId, uiCulture);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String | uiCulture |
Returns
| Type | Description |
| NSDocumentEntity |
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) Examples
NSDocumentAgent agent;
String filename;
NSStream dataStream;
String res = agent.CreateTempFile(filename, dataStream);
Parameters
| Type | Name | Description |
| String | filename |
Returns
| Type | Description |
| String |
DeleteDocumentEntity(Integer)
Deletes the NSDocumentEntity
Declaration
DeleteDocumentEntity(Integer documentEntity) Examples
NSDocumentAgent agent;
agent.DeleteDocumentEntity(123);
Parameters
| Type | Name | Description |
| Integer | documentEntity |
Returns
| Type | Description |
| Void |
DeletePhysicalDocument(Integer,String[])
Deletes the document contents
Declaration
NSReturnInfo DeletePhysicalDocument(Integer documentId, String[] allowedReturnType) Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnType;
NSReturnInfo res = agent.DeletePhysicalDocument(documentId, allowedReturnType);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String[] | allowedReturnType |
Returns
| Type | Description |
| NSReturnInfo |
DeleteTempFile(String)
Deletes a temporary file created with CreateTempFile.
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
Declaration
NSReturnInfo ExecuteDocumentCommand(Integer documentId, String versionId, String[] allowedReturnTypes, String command, String[] additionalData) Examples
NSDocumentAgent agent;
Integer documentId;
String versionId;
String[] allowedReturnTypes;
String command;
String[] additionalData;
NSReturnInfo res = agent.ExecuteDocumentCommand(documentId, versionId, allowedReturnTypes, command, additionalData);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String | versionId | |
| String[] | allowedReturnTypes | |
| String | command | |
| String[] | additionalData |
Returns
| Type | Description |
| NSReturnInfo |
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) Examples
NSDocumentAgent agent;
Integer appointmentId;
NSDocument[] res = agent.GetAppointmentDocuments(appointmentId);
Parameters
| Type | Name | Description |
| Integer | appointmentId |
Returns
| Type | Description |
| NSDocument[] |
GetCheckoutState(Integer)
Gets the current checkout state for a document, relative to the user performing the call.
Declaration
NSCheckoutInfo GetCheckoutState(Integer documentId) Examples
NSDocumentAgent agent;
Integer documentId;
NSCheckoutInfo res = agent.GetCheckoutState(documentId);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSCheckoutInfo |
GetContactDocuments(Integer,Integer)
Returns a specified number of document appointments within a time range.
Declaration
NSDocument[] GetContactDocuments(Integer contactId, DateTime startTime, DateTime endTime, Integer count) Examples
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetContactDocuments(contactId, startTime, endTime, count);
Parameters
| Type | Name | Description |
| Integer | contactId | |
| Integer | count |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the contact specified. |
GetContactDocumentsByTemplateHeading(Integer,Integer,Integer)
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) Examples
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetContactDocumentsByTemplateHeading(contactId, startTime, endTime, count, 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. |
GetContactDocumentsByTemplateType(Integer,Integer,Integer)
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) Examples
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetContactDocumentsByTemplateType(contactId, startTime, endTime, count, documentTemplateId);
Parameters
| Type | Name | Description |
| Integer | contactId | |
| Integer | count | |
| Integer | documentTemplateId |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the contact specified. |
GetContactDocumentsByTemplateTypes(Integer,Integer,Integer[])
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) Examples
NSDocumentAgent agent;
Integer contactId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer[] documentTemplateIds;
NSDocument[] res = agent.GetContactDocumentsByTemplateTypes(contactId, startTime, endTime, count, documentTemplateIds);
Parameters
| Type | Name | Description |
| Integer | contactId | |
| Integer | count | |
| Integer[] | documentTemplateIds |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the contact specified. |
GetDocument(Integer)
Gets an NSDocument object.
Declaration
NSDocument GetDocument(Integer documentId) Examples
NSDocumentAgent agent;
NSDocument thing = agent.GetDocument(123);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSDocument |
GetDocumentCommands(Integer,String[])
Gets a list of custom commands valid for the specific document at this time.
Declaration
NSCommandInfo[] GetDocumentCommands(Integer documentId, String[] allowedReturnTypes) Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSCommandInfo[] res = agent.GetDocumentCommands(documentId, allowedReturnTypes);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String[] | allowedReturnTypes |
Returns
| Type | Description |
| NSCommandInfo[] |
GetDocumentEntity(Integer)
Gets an NSDocumentEntity object.
Declaration
NSDocumentEntity GetDocumentEntity(Integer documentEntityId) Examples
NSDocumentAgent agent;
NSDocumentEntity thing = agent.GetDocumentEntity(123);
Parameters
| Type | Name | Description |
| Integer | documentEntityId |
Returns
| Type | Description |
| NSDocumentEntity |
GetDocumentList(Integer[])
Gets an array of NSDocument objects.
Declaration
NSDocument[] GetDocumentList(Integer[] documentIds) Examples
Integer[] ids;
NSDocumentAgent agent;
NSDocument[] docs = agent.GetDocumentList(ids);
Parameters
| Type | Name | Description |
| Integer[] | documentIds |
Returns
| Type | Description |
| NSDocument[] |
GetDocumentProperties(Integer,String[])
Gets plugin-dependent properties for the document.
Declaration
Map GetDocumentProperties(Integer documentId, String[] requestedProperties) Examples
NSDocumentAgent agent;
Integer documentId;
String[] requestedProperties;
Map res = agent.GetDocumentProperties(documentId, requestedProperties);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String[] | requestedProperties |
Returns
| Type | Description |
| Map |
GetDocumentsByTemplateHeading(Integer)
Returns document appointments, filtered by the document template heading.
Declaration
NSDocument[] GetDocumentsByTemplateHeading(Integer templateHeadingId) Examples
NSDocumentAgent agent;
Integer templateHeadingId;
NSDocument[] res = agent.GetDocumentsByTemplateHeading(templateHeadingId);
Parameters
| Type | Name | Description |
| Integer | templateHeadingId | The heading represents a grouping or filtering of document templates. |
Returns
| Type | Description |
| NSDocument[] |
GetDocumentStream(Integer)
Gets the document content as a stream
Declaration
NSStream GetDocumentStream(Integer documentId) Examples
NSDocumentAgent agent;
Integer documentId;
NSStream res = agent.GetDocumentStream(documentId);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSStream |
GetDocumentStreamFromEntity(NSDocumentEntity)
Gets the document as a stream
Declaration
NSStream GetDocumentStreamFromEntity(NSDocumentEntity documentEntity) Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
NSStream res = agent.GetDocumentStreamFromEntity(documentEntity);
Parameters
| Type | Name | Description |
| NSDocumentEntity | documentEntity |
Returns
| Type | Description |
| NSStream |
GetDocumentUrl(Integer,String,Bool)
Gets a URL referring to the given document content.
Declaration
String GetDocumentUrl(Integer documentId, String versionId, Bool writeableUrl) Examples
NSDocumentAgent agent;
Integer documentId;
String versionId;
Bool writeableUrl;
String res = agent.GetDocumentUrl(documentId, versionId, writeableUrl);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String | versionId | |
| Bool | writeableUrl |
Returns
| Type | Description |
| String | The returned string is a fully qualified URL. |
GetMyPublishedDocuments()
Declaration
NSDocument[] GetMyPublishedDocuments() Examples
NSDocumentAgent agent;
NSDocument[] res = agent.GetMyPublishedDocuments();
Returns
| Type | Description |
| NSDocument[] |
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) Examples
NSDocumentAgent agent;
Integer personId;
NSDocument[] res = agent.GetPersonDocuments(personId);
Parameters
| Type | Name | Description |
| Integer | personId |
Returns
| Type | Description |
| NSDocument[] |
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) Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetPersonDocumentsByDate(personId, includeProjectDocuments, startTime, endTime, count);
Parameters
| Type | Name | Description |
| Integer | personId | |
| Bool | includeProjectDocuments | |
| Integer | count |
Returns
| Type | Description |
| NSDocument[] |
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) 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);
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. |
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) 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);
Parameters
| Type | Name | Description |
| Integer | personId | |
| Bool | includeProjectDocuments | |
| Integer | count | |
| Integer | documentTemplateId |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the person specified. |
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) 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);
Parameters
| Type | Name | Description |
| Integer | personId | |
| Bool | includeProjectDocuments | |
| Integer | count | |
| Integer[] | documentTemplateIds |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the person specified. |
GetPluginCapabilities(Integer)
Gets a list of plugin-dependent capabilities for a given document archive plugin.
Declaration
Map GetPluginCapabilities(Integer pluginId) Examples
NSDocumentAgent agent;
Integer pluginId;
Map res = agent.GetPluginCapabilities(pluginId);
Parameters
| Type | Name | Description |
| Integer | pluginId |
Returns
| Type | Description |
| Map | A standard set of properties is defined in SuperOffice.CRM.Documents.Constants.Capabilities. |
GetPluginList()
Gets a list of installed document plugins
Declaration
Map GetPluginList() Examples
NSDocumentAgent agent;
Map res = agent.GetPluginList();
Returns
| Type | Description |
| Map |
GetPreviewDocumentStream(Integer)
Gets the preview version of the document content as a stream. Retrieves a sanitized version if possible
Declaration
NSDocumentPreview GetPreviewDocumentStream(Integer documentId) Examples
NSDocumentAgent agent;
Integer documentId;
NSDocumentPreview res = agent.GetPreviewDocumentStream(documentId);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSDocumentPreview |
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) Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetProjectDocuments(projectId, startTime, endTime, count);
Parameters
| Type | Name | Description |
| Integer | projectId | |
| Integer | count |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the project specified. |
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) Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetProjectDocumentsByTemplateHeading(projectId, startTime, endTime, count, 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. |
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) Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetProjectDocumentsByTemplateType(projectId, startTime, endTime, count, documentTemplateId);
Parameters
| Type | Name | Description |
| Integer | projectId | |
| Integer | count | |
| Integer | documentTemplateId |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the project specified. |
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) Examples
NSDocumentAgent agent;
Integer projectId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer[] documentTemplateIds;
NSDocument[] res = agent.GetProjectDocumentsByTemplateTypes(projectId, startTime, endTime, count, documentTemplateIds);
Parameters
| Type | Name | Description |
| Integer | projectId | |
| Integer | count | |
| Integer[] | documentTemplateIds |
Returns
| Type | Description |
| NSDocument[] |
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) Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetProjectMemberDocuments(personId, startTime, endTime, count);
Parameters
| Type | Name | Description |
| Integer | personId | |
| Integer | count |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the project member specified. |
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) Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer templateHeadingId;
NSDocument[] res = agent.GetProjectMemberDocumentsByTemplateHeading(personId, startTime, endTime, count, 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. |
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) Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer documentTemplateId;
NSDocument[] res = agent.GetProjectMemberDocumentsByTemplateType(personId, startTime, endTime, count, documentTemplateId);
Parameters
| Type | Name | Description |
| Integer | personId | |
| Integer | count | |
| Integer | documentTemplateId |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the project member specified. |
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) Examples
NSDocumentAgent agent;
Integer personId;
DateTime startTime;
DateTime endTime;
Integer count;
Integer[] documentTemplateIds;
NSDocument[] res = agent.GetProjectMemberDocumentsByTemplateTypes(personId, startTime, endTime, count, documentTemplateIds);
Parameters
| Type | Name | Description |
| Integer | personId | |
| Integer | count | |
| Integer[] | documentTemplateIds |
Returns
| Type | Description |
| NSDocument[] | The document appointments belong to the project member specified. |
GetPublishedDocument(Integer)
Gets the document if it's published
Declaration
NSDocument GetPublishedDocument(Integer documentId) Examples
NSDocumentAgent agent;
Integer documentId;
NSDocument res = agent.GetPublishedDocument(documentId);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSDocument |
GetPublishedDocuments(Integer[])
Gets the published documents from an array of document IDs.
Declaration
NSDocument[] GetPublishedDocuments(Integer[] documentIds) Examples
NSDocumentAgent agent;
Integer[] documentIds;
NSDocument[] res = agent.GetPublishedDocuments(documentIds);
Parameters
| Type | Name | Description |
| Integer[] | documentIds |
Returns
| Type | Description |
| NSDocument[] |
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) Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetPublishedDocumentsByDate(personId, includeProjectDocuments, startTime, endTime, 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. |
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) Examples
NSDocumentAgent agent;
Integer personId;
Bool includeProjectDocuments;
DateTime startTime;
DateTime endTime;
Integer count;
NSDocument[] res = agent.GetPublishedPersonDocumentsByDate(personId, includeProjectDocuments, startTime, endTime, 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. |
GetPublishedProjectDocuments(Integer)
Gets published appointment documents by project ID.
Declaration
NSDocument[] GetPublishedProjectDocuments(Integer projectId) Examples
NSDocumentAgent agent;
Integer projectId;
NSDocument[] res = agent.GetPublishedProjectDocuments(projectId);
Parameters
| Type | Name | Description |
| Integer | projectId |
Returns
| Type | Description |
| NSDocument[] |
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) Examples
NSDocumentAgent agent;
Integer saleId;
NSDocument[] res = agent.GetSaleDocuments(saleId);
Parameters
| Type | Name | Description |
| Integer | saleId |
Returns
| Type | Description |
| NSDocument[] |
GetSanitizedDocumentStream(Integer)
Gets the document content as a stream. Retrieves a sanitized version if possible
Declaration
NSStream GetSanitizedDocumentStream(Integer documentId) Examples
NSDocumentAgent agent;
Integer documentId;
NSStream res = agent.GetSanitizedDocumentStream(documentId);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSStream |
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) Examples
NSDocumentAgent agent;
String templateName;
Bool allowPersonal;
String uiCulture;
NSStream res = agent.GetSanitizedTemplateStream(templateName, allowPersonal, uiCulture);
Parameters
| Type | Name | Description |
| String | templateName | |
| Bool | allowPersonal | |
| String | uiCulture |
Returns
| Type | Description |
| NSStream |
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) Examples
NSDocumentAgent agent;
Integer templateId;
String uiCulture;
NSStream res = agent.GetSanitizedTemplateStreamFromId(templateId, uiCulture);
Parameters
| Type | Name | Description |
| Integer | templateId | |
| String | uiCulture |
Returns
| Type | Description |
| NSStream |
GetSuggestedDocumentEntity(Integer)
Gets an NSSuggestedDocumentEntity object.
Declaration
NSSuggestedDocumentEntity GetSuggestedDocumentEntity(Integer suggestedDocumentEntityId) Examples
NSDocumentAgent agent;
NSSuggestedDocumentEntity thing = agent.GetSuggestedDocumentEntity(123);
Parameters
| Type | Name | Description |
| Integer | suggestedDocumentEntityId |
Returns
| Type | Description |
| NSSuggestedDocumentEntity |
GetTempFile(String)
Gets data stream for temporary file created with CreateTempFile.
Declaration
NSStream GetTempFile(String filename) Examples
NSDocumentAgent agent;
String filename;
NSStream res = agent.GetTempFile(filename);
Parameters
| Type | Name | Description |
| String | filename |
Returns
| Type | Description |
| NSStream |
GetTemplateStream(String,Bool,String)
Retrieve a stream to a mail template based on its name
Declaration
NSStream GetTemplateStream(String templateName, Bool allowPersonal, String uiCulture) Examples
NSDocumentAgent agent;
String templateName;
Bool allowPersonal;
String uiCulture;
NSStream res = agent.GetTemplateStream(templateName, allowPersonal, uiCulture);
Parameters
| Type | Name | Description |
| String | templateName | |
| Bool | allowPersonal | |
| String | uiCulture |
Returns
| Type | Description |
| NSStream |
GetTemplateStreamFromId(Integer,String)
Retrieve a stream to a document template based on its ID
Declaration
NSStream GetTemplateStreamFromId(Integer templateId, String uiCulture) Examples
NSDocumentAgent agent;
Integer templateId;
String uiCulture;
NSStream res = agent.GetTemplateStreamFromId(templateId, uiCulture);
Parameters
| Type | Name | Description |
| Integer | templateId | |
| String | uiCulture |
Returns
| Type | Description |
| NSStream |
GetUnsanitizedPreviewDocumentStream(Integer)
Gets the preview version of the document content as a stream. Retrieves an unsanitized version.
Declaration
NSDocumentPreview GetUnsanitizedPreviewDocumentStream(Integer documentId) Examples
NSDocumentAgent agent;
Integer documentId;
NSDocumentPreview res = agent.GetUnsanitizedPreviewDocumentStream(documentId);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSDocumentPreview |
GetVersionList(Integer)
Gets a list of existing, committed versions for a given document
Declaration
NSVersionInfo[] GetVersionList(Integer documentId) Examples
NSDocumentAgent agent;
Integer documentId;
NSVersionInfo[] res = agent.GetVersionList(documentId);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSVersionInfo[] |
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) Examples
NSDocumentAgent agent;
Integer documentId;
String newFilename;
String res = agent.RenameDocument(documentId, newFilename);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String | newFilename |
Returns
| Type | Description |
| String |
SaveDocumentEntity(NSDocumentEntity)
Updates the existing NSDocumentEntity or creates a new NSDocumentEntity if the id parameter is 0
Declaration
NSDocumentEntity SaveDocumentEntity(NSDocumentEntity documentEntity) Examples
NSDocument agent;
NSDocumentEntity thing = agent.CreateDefaultDocumentEntity();
thing = agent.SaveDocumentEntity(thing);
Parameters
| Type | Name | Description |
| NSDocumentEntity | documentEntity | The NSDocumentEntity to save. |
Returns
| Type | Description |
| NSDocumentEntity |
SaveDocumentTemplateStream(Integer,NSStream,String,Integer)
Saves content in stream to document template file
Declaration
NSTemplateInfo SaveDocumentTemplateStream(Integer documentTemplateId, NSStream content, String languageCode, Integer pluginId) Examples
NSDocumentAgent agent;
Integer documentTemplateId;
NSStream content;
String languageCode;
Integer pluginId;
NSTemplateInfo res = agent.SaveDocumentTemplateStream(documentTemplateId, content, languageCode, pluginId);
Parameters
| Type | Name | Description |
| Integer | documentTemplateId | |
| NSStream | content | |
| String | languageCode | |
| Integer | pluginId |
Returns
| Type | Description |
| NSTemplateInfo |
SavePrivacyReport(String,String,Integer)
Generates a PDF from HTML and makes a document
Declaration
Integer SavePrivacyReport(String htmlReport, String title, Integer personId) Examples
NSDocumentAgent agent;
String htmlReport;
String title;
Integer personId;
Integer res = agent.SavePrivacyReport(htmlReport, title, personId);
Parameters
| Type | Name | Description |
| String | htmlReport | |
| String | title | |
| Integer | personId |
Returns
| Type | Description |
| Integer |
SaveSuggestedDocumentEntity(NSSuggestedDocumentEntity)
Updates the existing NSSuggestedDocumentEntity or creates a new NSSuggestedDocumentEntity if the id parameter is 0
Declaration
NSSuggestedDocumentEntity SaveSuggestedDocumentEntity(NSSuggestedDocumentEntity suggestedDocumentEntity) Examples
NSDocument agent;
NSSuggestedDocumentEntity thing = agent.CreateDefaultSuggestedDocumentEntity();
thing = agent.SaveSuggestedDocumentEntity(thing);
Parameters
| Type | Name | Description |
| NSSuggestedDocumentEntity | suggestedDocumentEntity | The NSSuggestedDocumentEntity to save. |
Returns
| Type | Description |
| NSSuggestedDocumentEntity |
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) Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
NSStream stream;
Bool overwriteExistingData;
NSDocumentEntity res = agent.SetDocumentStream(documentEntity, stream, overwriteExistingData);
Parameters
| Type | Name | Description |
| NSDocumentEntity | documentEntity | |
| Bool | overwriteExistingData |
Returns
| Type | Description |
| NSDocumentEntity |
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) Examples
NSDocumentAgent agent;
Integer documentId;
NSStream stream;
NSDocumentEntity res = agent.SetDocumentStreamFromId(documentId, stream);
Parameters
| Type | Name | Description |
| Integer | documentId |
Returns
| Type | Description |
| NSDocumentEntity |
SetTemplateStream(String,Bool,NSStream)
Saves a mail signature template to the document archive
Declaration
Void SetTemplateStream(String filename, Bool personal, NSStream stream) Examples
NSDocumentAgent agent;
String filename;
Bool personal;
NSStream stream;
agent.SetTemplateStream(filename, personal, stream);
Parameters
| Type | Name | Description |
| String | filename | |
| Bool | personal | |
| NSStream | stream |
Returns
| Type | Description |
| Void |
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) Examples
NSDocumentAgent agent;
Integer documentId;
Integer associateId;
String[] customTags;
String[] customValues;
NSStream res = agent.SubstituteMergeDocumentTemplateVariables(documentId, associateId, customTags, 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 |
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) Examples
NSDocumentAgent agent;
Integer documentId;
Integer associateId;
Map customTags;
NSStream res = agent.SubstituteMergeDocumentTemplateVariables2(documentId, associateId, 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 |
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) 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);
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 |
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) 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);
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 |
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) 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);
Parameters
| Type | Name | Description |
| String | source | |
| Integer | generatorEncoding | See <xref href="CRMScript.NetServer.GeneratorEncoding" data-throw-if-not-resolved="false"></xref> |
| Integer | contactId | |
| Integer | personId | |
| Integer | appointmentId | |
| Integer | documentId | |
| Integer | saleId | |
| Integer | selectionId | |
| Integer | projectId | |
| String | cultureName |
Returns
| Type | Description |
| String |
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) Examples
NSDocumentAgent agent;
NSTemplateVariablesParameters parameters;
String res = agent.SubstituteTemplateVariablesEx(parameters);
Returns
| Type | Description |
| String |
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.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) 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);
Parameters
| Type | Name | Description |
| String | source | |
| Integer | generatorEncoding | See <xref href="CRMScript.NetServer.GeneratorEncoding" data-throw-if-not-resolved="false"></xref> |
| String[] | customTags | |
| String[] | customValues | |
| Integer | contactId | |
| Integer | personId | |
| Integer | appointmentId | |
| Integer | documentId | |
| Integer | saleId | |
| Integer | selectionId | |
| Integer | projectId | |
| String | cultureName |
Returns
| Type | Description |
| String |
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.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) 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);
Parameters
| Type | Name | Description |
| String | source | |
| Integer | generatorEncoding | See <xref href="CRMScript.NetServer.GeneratorEncoding" data-throw-if-not-resolved="false"></xref> |
| Map | customTags | |
| Integer | contactId | |
| Integer | personId | |
| Integer | appointmentId | |
| Integer | documentId | |
| Integer | saleId | |
| Integer | selectionId | |
| Integer | projectId | |
| String | cultureName |
Returns
| Type | Description |
| String |
UndoCheckoutDocument(Integer,String[])
Undoes (abandon) a checkout
Declaration
NSReturnInfo UndoCheckoutDocument(Integer documentId, String[] allowedReturnTypes) Examples
NSDocumentAgent agent;
Integer documentId;
String[] allowedReturnTypes;
NSReturnInfo res = agent.UndoCheckoutDocument(documentId, allowedReturnTypes);
Parameters
| Type | Name | Description |
| Integer | documentId | |
| String[] | allowedReturnTypes |
Returns
| Type | Description |
| NSReturnInfo |
ValidateDocumentEntity(NSDocumentEntity)
Checks that entity is ready for saving, return error messages by field.
Declaration
Map ValidateDocumentEntity(NSDocumentEntity documentEntity) Examples
NSDocumentAgent agent;
NSDocumentEntity documentEntity;
Map res = agent.ValidateDocumentEntity(documentEntity);
Parameters
| Type | Name | Description |
| NSDocumentEntity | documentEntity |
Returns
| Type | Description |
| Map |