Interface IDocumentAgent
Interface for the Document Agent Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Document Agent", "Interface for the Document Agent. Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.")]
public interface IDocumentAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
Methods
CheckinDocument(Int32, String[], String, String[])
Check in a currently checked-out document
Declaration
ReturnInfo CheckinDocument(int documentId, string[] allowedReturnTypes, string versionDescription, string[] versionExtraFields)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document Id |
String[] | allowedReturnTypes | List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests. |
String | versionDescription | Optional textual description related to this version of the document; may be blank, and is discarded if the document/plugin do not support versioning. |
String[] | versionExtraFields | Optional extra metadata related to the new version (as opposed to metadata related to the document as a whole). Discarded if the document/plugin do not support versioning. |
Returns
Type | Description |
---|---|
ReturnInfo | Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CheckoutDocument(Int32, String[])
Check out a document for editing by the current user.
Declaration
ReturnInfo CheckoutDocument(int documentId, string[] allowedReturnTypes)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
String[] | allowedReturnTypes | List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests. |
Returns
Type | Description |
---|---|
ReturnInfo | Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CopyDocumentToCsAttachment(Int32)
Copy a crm document to cs attachemnt. For use in mailings
Declaration
int CopyDocumentToCsAttachment(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The primary key of the document to copy to the cs attachment |
Returns
Type | Description |
---|---|
Int32 | The primary key of the newly added attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateDefaultDocumentEntity()
Loading default values into a new DocumentEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
DocumentEntity CreateDefaultDocumentEntity()
Returns
Type | Description |
---|---|
DocumentEntity | New DocumentEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateDefaultDocumentEntityFromSuggestion(Int32)
Interface for the Document Agent Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.
Declaration
DocumentEntity CreateDefaultDocumentEntityFromSuggestion(int suggestedDocumentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | suggestedDocumentId |
Returns
Type | Description |
---|---|
DocumentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateDefaultDocumentPreview()
Loading default values into a new DocumentPreview. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
DocumentPreview CreateDefaultDocumentPreview()
Returns
Type | Description |
---|---|
DocumentPreview | New DocumentPreview with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateDefaultSuggestedDocumentEntity()
Loading default values into a new SuggestedDocumentEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
SuggestedDocumentEntity CreateDefaultSuggestedDocumentEntity()
Returns
Type | Description |
---|---|
SuggestedDocumentEntity | New SuggestedDocumentEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateDefaultTemplateVariablesParameters()
Loading default values into a new TemplateVariablesParameters. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
TemplateVariablesParameters CreateDefaultTemplateVariablesParameters()
Returns
Type | Description |
---|---|
TemplateVariablesParameters | New TemplateVariablesParameters with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateDocumentStream(DocumentEntity, Boolean)
Creates a new Stream that can be used to store the document in the file archive.
Declaration
Stream CreateDocumentStream(DocumentEntity documentEntity, bool overwriteExistingData)
Parameters
Type | Name | Description |
---|---|---|
DocumentEntity | documentEntity | The document the stream belongs to |
Boolean | overwriteExistingData | If true, the stream will overwrite existing data stored for this record in the document archive |
Returns
Type | Description |
---|---|
Stream | A writeable stream. When written and closed, the stream will become the new document content, subject to locking and versioning constraints. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateNewPhysicalDocumentFromTemplate(Int32, Int32, Int32, Int32, Int32, Int32, Int32, String)
Create a new document content based on a document template and store it in the document archive. Tags are substituted according to the provided id's. 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.
Declaration
DocumentEntity CreateNewPhysicalDocumentFromTemplate(int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | Identifier for a contact. Defaults to document's contact if 0 |
Int32 | personId | Identifier for a person. Defaults to document's person if 0 |
Int32 | appointmentId | identifier for an appointment. Defaults to document if 0 |
Int32 | documentId | Identifier for a document. The document defines the template to use. |
Int32 | saleId | Identifier for sale. Defaults to document's sale if 0. |
Int32 | selectionId | identifier for selection. |
Int32 | projectId | identifier for project. Defaults to document's project if 0 |
String | uiCulture | Language variation of template to use when creating document content. (ISO code "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
DocumentEntity | The updated document entity, after creating the document content from the template. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateNewPhysicalDocumentFromTemplateWithCustomTags(Int32, Int32, Int32, Int32, Int32, Int32, Int32, String[], String[], String)
Create a new physical document based on a document template and store it in the document archive. Tags are substituted according to the provided id's. 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.
Declaration
DocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags(int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string[] customTags, string[] customValues, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | Identifier for a contact. Defaults to document's contact if 0 |
Int32 | personId | Identifier for a person. Defaults to document's person if 0 |
Int32 | appointmentId | identifier for an appointment. Defaults to document if 0 |
Int32 | documentId | Identifier for the document |
Int32 | saleId | Identifier for sale. Defaults to document's sale if 0. |
Int32 | selectionId | identifier for selection. |
Int32 | projectId | identifier for project. Defaults to document's project if 0 |
String[] | customTags | Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
String[] | customValues | Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
String | uiCulture | Language variation of template to use when creating document. (ISO code - "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
DocumentEntity | The document object with updated info after creating the document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateNewPhysicalDocumentFromTemplateWithCustomTags2(Int32, Int32, Int32, Int32, Int32, Int32, Int32, StringDictionary, String)
Create a new physical document based on a document template and store it in the document archive. Tags are substituted according to the provided id's. 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.
Declaration
DocumentEntity CreateNewPhysicalDocumentFromTemplateWithCustomTags2(int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, StringDictionary customTags, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | Identifier for a contact. Defaults to document's contact if 0 |
Int32 | personId | Identifier for a person. Defaults to document's person if 0 |
Int32 | appointmentId | identifier for an appointment. Defaults to document if 0 |
Int32 | documentId | Identifier for the document |
Int32 | saleId | Identifier for sale. Defaults to document's sale if 0. |
Int32 | selectionId | identifier for selection. |
Int32 | projectId | identifier for project. Defaults to document's project if 0 |
StringDictionary | customTags | Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag. |
String | uiCulture | Language variation of template to use when creating document. (ISO code - "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
DocumentEntity | The document object with updated info after creating the document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateNewPhysicalMailMergeDocumentFromTemplate(Int32, String)
Create a new physical document based on the documents template. 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.
Declaration
DocumentEntity CreateNewPhysicalMailMergeDocumentFromTemplate(int documentId, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | Identifier for a document. The template to use is stored in the document entity. |
String | uiCulture | Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
DocumentEntity | The document object with updated info after creating the document. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
CreateTempFile(String, Stream)
Create a new temporary file based on the provided stream. Specified filename may be overridden, and actual name is returned.
Declaration
string CreateTempFile(string filename, Stream dataStream)
Parameters
Type | Name | Description |
---|---|---|
String | filename | Wanted name of file. |
Stream | dataStream | Data to be added to the file. |
Returns
Type | Description |
---|---|
String | Actual used filename. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
DeleteDocumentEntity(Int32)
Deletes the DocumentEntity
Declaration
void DeleteDocumentEntity(int documentEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentEntityId | The identity of the DocumentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
DeletePhysicalDocument(Int32, String[])
Delete the document contents
Declaration
ReturnInfo DeletePhysicalDocument(int documentId, string[] allowedReturnType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | document primary key |
String[] | allowedReturnType | List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing. Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests |
Returns
Type | Description |
---|---|
ReturnInfo | Delete status - did removal succeed or not |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
DeleteTempFile(String)
Delete a temporary file created with CreateTempFile.
Declaration
void DeleteTempFile(string filename)
Parameters
Type | Name | Description |
---|---|---|
String | filename | Name of temporary file to delete. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
ExecuteDocumentCommand(Int32, String, String[], String, String[])
Execute a custom command on a particular document, optionally a particular version
Declaration
ReturnInfo ExecuteDocumentCommand(int documentId, string versionId, string[] allowedReturnTypes, string command, string[] additionalData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
String | versionId | Version ID if applicable/desired; a blank value implies "latest" version and is always acceptable. |
String[] | allowedReturnTypes | List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests. |
String | command | Command name, generally matching one of those returned from the GetDocumentCommands service. However, it is legal for document plugins to support commands that are not declared through GetDocumentCommands, for instance if a custom GUI needs to access plugin functionality. |
String[] | additionalData | Any additional data that the document command needs. This parameter can be used as a tunnel between a custom-programmed GUI and its plugin.<br/>It is suggested that the format is name=value, with one such pair per array item. |
Returns
Type | Description |
---|---|
ReturnInfo | Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetAppointmentDocuments(Int32)
Get all documents that are linked to the appointment. I.e. the documents that are listed in the appointment dialog.
Declaration
Document[] GetAppointmentDocuments(int appointmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | appointmentId | The appointment id. |
Returns
Type | Description |
---|---|
Document[] | Array of documents |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetCheckoutState(Int32)
Get the current checkout state for a document, relative to the user perforing the call.
Declaration
CheckoutInfo GetCheckoutState(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
Returns
Type | Description |
---|---|
CheckoutInfo | Current checkout state of the document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetContactDocuments(Int32, DateTime, DateTime, Int32)
Method that returns a specified number of document appointments within a time range. The document appointments belong to the contact specified.
Declaration
Document[] GetContactDocuments(int contactId, DateTime startTime, DateTime endTime, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetContactDocumentsByTemplateHeading(Int32, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by the document template heading. The document appointments belong to the contact specified. The heading represents a grouping or filtering of document templates.
Declaration
Document[] GetContactDocumentsByTemplateHeading(int contactId, DateTime startTime, DateTime endTime, int count, int templateHeadingId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | templateHeadingId | The document template heading id. The heading represents a grouping or filtering of document templates. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetContactDocumentsByTemplateType(Int32, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the contact specified.
Declaration
Document[] GetContactDocumentsByTemplateType(int contactId, DateTime startTime, DateTime endTime, int count, int documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | documentTemplateId | Id of the document template type to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetContactDocumentsByTemplateTypes(Int32, DateTime, DateTime, Int32, Int32[])
Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the contact specified.
Declaration
Document[] GetContactDocumentsByTemplateTypes(int contactId, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32[] | documentTemplateIds | Ids of the document template types to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocument(Int32)
Gets a Document object.
Declaration
Document GetDocument(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The identifier of the Document object |
Returns
Type | Description |
---|---|
Document | Document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentCommands(Int32, String[])
Get a list of custom commands valid for the specific document at this time. This information should not be cached by clients, as it may change between documents and over time.
Declaration
CommandInfo[] GetDocumentCommands(int documentId, string[] allowedReturnTypes)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
String[] | allowedReturnTypes | List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests.<br/>In this context the parameter is used to filter the returned command list, so that commands that require return actions not supported, will not be included by the document plugin. |
Returns
Type | Description |
---|---|
CommandInfo[] | Array of command information items. The command list is constrained by the allowedReturnTypes parameter. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentEntity(Int32)
Gets a DocumentEntity object.
Declaration
DocumentEntity GetDocumentEntity(int documentEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentEntityId | The identifier of the DocumentEntity object |
Returns
Type | Description |
---|---|
DocumentEntity | DocumentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentLength(Int32, String)
Get length of the document content in bytes.
Declaration
long GetDocumentLength(int documentId, string versionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document id |
String | versionId | Version ID if applicable; a blank value implies "latest" version and is always acceptable. |
Returns
Type | Description |
---|---|
Int64 | The length of the document content in bytes. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentList(Int32[])
Gets an array of Document objects.
Declaration
Document[] GetDocumentList(int[] documentIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | documentIds | The identifiers of the Document object |
Returns
Type | Description |
---|---|
Document[] | Array of Document objects |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentProperties(Int32, String[])
Get plugin-dependent properties for the document. A number of standard properties that should be supported by all plugins are defined in SuperOffice.CRM.Documents.Constants.Properties.
Declaration
StringDictionary GetDocumentProperties(int documentId, string[] requestedProperties)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
String[] | requestedProperties | Array of property names whose values are being requested. |
Returns
Type | Description |
---|---|
StringDictionary | Dictionary of name=value pairs, corresponding to the requested properties. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentsByTemplateHeading(Int32)
Method that returns document appointments, filtered by the document template heading. The heading represents a grouping or filtering of document templates.
Declaration
Document[] GetDocumentsByTemplateHeading(int templateHeadingId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | templateHeadingId | The document template heading id. The heading represents a grouping or filtering of document templates. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentStream(Int32)
Get the document content as a stream
Declaration
Stream GetDocumentStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document id |
Returns
Type | Description |
---|---|
Stream | The document as a Stream. This stream can be read once and clients should not assume it remains valid after a ReadToEnd or Close. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentStreamFromEntity(DocumentEntity)
Get the document as a stream
Declaration
Stream GetDocumentStreamFromEntity(DocumentEntity documentEntity)
Parameters
Type | Name | Description |
---|---|---|
DocumentEntity | documentEntity | The document entity object that refers to the binary data (document) |
Returns
Type | Description |
---|---|
Stream | The document as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetDocumentUrl(Int32, String, Boolean)
Get a URL referring to the given document content.<para/>This URL may be passed to the ultimate client (text editor of some kind?), which is then responsible for all further operations.<para/>The returned string is a fully qualified URL.<para/>Not all documents and document plugins support this feature.
Declaration
string GetDocumentUrl(int documentId, string versionId, bool writeableUrl)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document primary key |
String | versionId | Version ID if applicable/desired; a blank value implies "latest" version and is always acceptable. |
Boolean | writeableUrl | If true, then a URL that supports saving is requested. Som edocument plugins may not support read-only URLs, so there is no guarantee that a False value will actually yield a read-only URL, and vice versa. |
Returns
Type | Description |
---|---|
String | Fully resolved URL referring to the document. May be NULL or blank if plugin does not support URLs. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetMyPublishedDocuments()
Interface for the Document Agent Collection of all services that works with Document data. This is services for the document information, not the physical document themselves. These are handled by the BLOB service methods.
Declaration
Document[] GetMyPublishedDocuments()
Returns
Type | Description |
---|---|
Document[] | Array of documents |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPersonDocuments(Int32)
Get all documents that are linked to the person. I.e. the documents that are listed in the person dialog.
Declaration
Document[] GetPersonDocuments(int personId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id. |
Returns
Type | Description |
---|---|
Document[] | Array of documents |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPersonDocumentsByDate(Int32, Boolean, DateTime, DateTime, Int32)
Method that returns a specified number of document appointments within a time range. The document appointments belong to the person specified.
Declaration
Document[] GetPersonDocumentsByDate(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the SuperOffice user (associate). |
Boolean | includeProjectDocuments | If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person. |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPersonDocumentsByTemplateHeading(Int32, Boolean, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by document template heading. The document appointments belong to the person specified. The heading represents a grouping or filtering of document templates.
Declaration
Document[] GetPersonDocumentsByTemplateHeading(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, int templateHeadingId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the SuperOffice user (associate). |
Boolean | includeProjectDocuments | If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person. |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | templateHeadingId | The document template heading id. The heading represents a grouping or filtering of document templates. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPersonDocumentsByTemplateType(Int32, Boolean, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the person specified.
Declaration
Document[] GetPersonDocumentsByTemplateType(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, int documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the SuperOffice user (associate). |
Boolean | includeProjectDocuments | If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person. |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | documentTemplateId | Id of the document template type to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPersonDocumentsByTemplateTypes(Int32, Boolean, DateTime, DateTime, Int32, Int32[])
Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the person specified.
Declaration
Document[] GetPersonDocumentsByTemplateTypes(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the SuperOffice user (associate). |
Boolean | includeProjectDocuments | If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person. |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32[] | documentTemplateIds | Ids of the document template types to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPluginCapabilities(Int32)
Get a list of plugin-dependent capabilities for a given document archive plugin.<br/>A standard set of properties is defined in SuperOffice.CRM.Documents.Constants.Capabilities.
Declaration
StringDictionary GetPluginCapabilities(int pluginId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | pluginId | Numeric document plugin id, corresponding to the document.archiveProvider id or doctmpl.autoeventid. |
Returns
Type | Description |
---|---|
StringDictionary | Dictionary mapping capability names=values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPluginList()
Get a list of installed document plugins
Declaration
StringDictionary GetPluginList()
Returns
Type | Description |
---|---|
StringDictionary | Dictionary mapping plugin id=plugin name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPreviewDocumentStream(Int32)
Get the preview version of the document content as a stream. Retrieves a sanitized version if possible
Declaration
DocumentPreview GetPreviewDocumentStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document id |
Returns
Type | Description |
---|---|
DocumentPreview | Preview version of the document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectDocuments(Int32, DateTime, DateTime, Int32)
Method that returns a specified number of document appointments within a time range. The document appointments belong to the project specified.
Declaration
Document[] GetProjectDocuments(int projectId, DateTime startTime, DateTime endTime, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectDocumentsByTemplateHeading(Int32, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by document template heading. The document appointments belong to the project specified. The heading represents a grouping or filtering of document templates.
Declaration
Document[] GetProjectDocumentsByTemplateHeading(int projectId, DateTime startTime, DateTime endTime, int count, int templateHeadingId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | templateHeadingId | The document template heading id. The heading represents a grouping or filtering of document templates. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectDocumentsByTemplateType(Int32, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the project specified.
Declaration
Document[] GetProjectDocumentsByTemplateType(int projectId, DateTime startTime, DateTime endTime, int count, int documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | documentTemplateId | Id of the document template type to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectDocumentsByTemplateTypes(Int32, DateTime, DateTime, Int32, Int32[])
Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the project specified.
Declaration
Document[] GetProjectDocumentsByTemplateTypes(int projectId, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32[] | documentTemplateIds | Ids of the document template types to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectMemberDocuments(Int32, DateTime, DateTime, Int32)
Method that returns a specified number of document appointments within a time range. The document appointments belong to the project member specified.
Declaration
Document[] GetProjectMemberDocuments(int personId, DateTime startTime, DateTime endTime, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The project member's person id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectMemberDocumentsByTemplateHeading(Int32, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by document template heading. The document appointments belong to the project member specified. The heading represents a grouping or filtering of document templates.
Declaration
Document[] GetProjectMemberDocumentsByTemplateHeading(int personId, DateTime startTime, DateTime endTime, int count, int templateHeadingId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The project member's person id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | templateHeadingId | The document template heading id. The heading represents a grouping or filtering of document templates. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectMemberDocumentsByTemplateType(Int32, DateTime, DateTime, Int32, Int32)
Method that returns a specified number of document appointments within a time range, filtered by document template type. The document appointments belong to the project member specified.
Declaration
Document[] GetProjectMemberDocumentsByTemplateType(int personId, DateTime startTime, DateTime endTime, int count, int documentTemplateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The project member's person id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32 | documentTemplateId | Id of the document template type to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetProjectMemberDocumentsByTemplateTypes(Int32, DateTime, DateTime, Int32, Int32[])
Method that returns a specified number of document appointments within a time range, filtered by document template types. The document appointments belong to the project member specified.
Declaration
Document[] GetProjectMemberDocumentsByTemplateTypes(int personId, DateTime startTime, DateTime endTime, int count, int[] documentTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The project member's person id |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Int32[] | documentTemplateIds | Ids of the document template types to filter on. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPublishedDocument(Int32)
Get the document if it's published
Declaration
Document GetPublishedDocument(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The document id |
Returns
Type | Description |
---|---|
Document | Document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPublishedDocuments(Int32[])
Get the published documents from an array of doucment ids.
Declaration
Document[] GetPublishedDocuments(int[] documentIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | documentIds | Array of document ids. |
Returns
Type | Description |
---|---|
Document[] | Array of Document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPublishedDocumentsByDate(Int32, Boolean, DateTime, DateTime, Int32)
Method that returns a specified number of published document appointments within a time range. The document appointments is visible to the person specified or the document is in a project the person belongs to.
Declaration
Document[] GetPublishedDocumentsByDate(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The personId |
Boolean | includeProjectDocuments | Include projectDocuments to select documents in projects person is a member of. |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPublishedPersonDocumentsByDate(Int32, Boolean, DateTime, DateTime, Int32)
Method that returns a specified number of published document appointments within a time range. The document appointments belong to the person specified or the document is in a project the person belongs to.
Declaration
Document[] GetPublishedPersonDocumentsByDate(int personId, bool includeProjectDocuments, DateTime startTime, DateTime endTime, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The person id of the SuperOffice user (associate). |
Boolean | includeProjectDocuments | If true, all appointments that belong to projects where the user is a project member are included as well as the appointments belonging to the person. |
DateTime | startTime | The start of the time interval we want appointments from. This will usually be the current time. |
DateTime | endTime | The end of the time interval. |
Int32 | count | The maximum number of appointments that should be returned. -1 means no count restrictions. |
Returns
Type | Description |
---|---|
Document[] | Array of Appointments. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetPublishedProjectDocuments(Int32)
Get published appointment documents by project id.
Declaration
Document[] GetPublishedProjectDocuments(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project id |
Returns
Type | Description |
---|---|
Document[] | Array of Appointment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetSaleDocuments(Int32)
Get all documents that are linked to the sale. I.e. the documents that are listed in the sale dialog.
Declaration
Document[] GetSaleDocuments(int saleId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | saleId | The sale id. |
Returns
Type | Description |
---|---|
Document[] | Array of documents |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetSanitizedDocumentStream(Int32)
Get the document content as a stream. Retrieves a sanitized version if possible
Declaration
Stream GetSanitizedDocumentStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document id |
Returns
Type | Description |
---|---|
Stream | The document as a Stream. This stream can be read once and clients should not assume it remains valid after a ReadToEnd or Close. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetSanitizedTemplateStream(String, Boolean, String)
Retrieve a stream to a mail template based on its name. Sanitizes the contents if possible.
Declaration
Stream GetSanitizedTemplateStream(string templateName, bool allowPersonal, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
String | templateName | Filename of mail template to retrieve |
Boolean | allowPersonal | If true, try looking up template in personal area before looking in shared document template area |
String | uiCulture | Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
Stream | Open stream to the mail template |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetSanitizedTemplateStreamFromId(Int32, String)
Retrieve a stream to a document template based on its id. Sanitizes the contents if possible.
Declaration
Stream GetSanitizedTemplateStreamFromId(int templateId, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Int32 | templateId | Id of template to retrieve |
String | uiCulture | Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
Stream | Open stream to the template |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetSuggestedDocumentEntity(Int32)
Gets a SuggestedDocumentEntity object.
Declaration
SuggestedDocumentEntity GetSuggestedDocumentEntity(int suggestedDocumentEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | suggestedDocumentEntityId | The identifier of the SuggestedDocumentEntity object |
Returns
Type | Description |
---|---|
SuggestedDocumentEntity | SuggestedDocumentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetTempFile(String)
Get data stream for temporary file created with CreateTempFile.
Declaration
Stream GetTempFile(string filename)
Parameters
Type | Name | Description |
---|---|---|
String | filename | Name of temporary file to retrieve. |
Returns
Type | Description |
---|---|
Stream | The document as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetTemplateStream(String, Boolean, String)
Retrieve a stream to a mail template based on its name
Declaration
Stream GetTemplateStream(string templateName, bool allowPersonal, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
String | templateName | Filename of mail template to retrieve |
Boolean | allowPersonal | If true, try looking up template in personal area before looking in shared document template area |
String | uiCulture | Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
Stream | Open stream to the mail template |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetTemplateStreamFromId(Int32, String)
Retrieve a stream to a document template based on its id
Declaration
Stream GetTemplateStreamFromId(int templateId, string uiCulture)
Parameters
Type | Name | Description |
---|---|---|
Int32 | templateId | Id of template to retrieve |
String | uiCulture | Language variation of template to use. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Returns
Type | Description |
---|---|
Stream | Open stream to the template |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetUnsanitizedPreviewDocumentStream(Int32)
Get the preview version of the document content as a stream. Retrieves an unsanitized version. This has less CPU impact but the caller must sanitize the content before presenting it to the user.
Declaration
DocumentPreview GetUnsanitizedPreviewDocumentStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document id |
Returns
Type | Description |
---|---|
DocumentPreview | Unsanitized preview version of the document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
GetVersionList(Int32)
Get a list of existing, committed versions for a given document
Declaration
VersionInfo[] GetVersionList(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document Id |
Returns
Type | Description |
---|---|
VersionInfo[] | Array of objects describing the existing, committed versions for this document |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
RenameDocument(Int32, String)
Rename the physical document, i.e., change the file name or equivalent concept in the document archive.
Declaration
string RenameDocument(int documentId, string newFilename)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
String | newFilename | Suggested new file name. The document archive may amend this to conform to uniqueness constraints, character range limitations etc. |
Returns
Type | Description |
---|---|
String | The actual, new "file" name. This will generally be derived from the suggested name, but may be amended. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SaveDocumentEntity(DocumentEntity)
Updates the existing DocumentEntity or creates a new DocumentEntity if the id parameter is empty
Declaration
DocumentEntity SaveDocumentEntity(DocumentEntity documentEntity)
Parameters
Type | Name | Description |
---|---|---|
DocumentEntity | documentEntity | The DocumentEntity that is saved. |
Returns
Type | Description |
---|---|
DocumentEntity | New or updated DocumentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SaveDocumentTemplateStream(Int32, Stream, String, Int32)
Saves content in stream to document template file
Declaration
TemplateInfo SaveDocumentTemplateStream(int documentTemplateId, Stream content, string languageCode, int pluginId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentTemplateId | Identifier for document template |
Stream | content | Stream containing content to be saved to document template file |
String | languageCode | Language variation of template to update. (ISO code: "en-US" or "nb-NO" etc). Used to select a template of the appropriate language. Can be overridden in SO ARC by user preference "PreferDocLang". |
Int32 | pluginId | Plugin id. Use -1 to use the plugin specified in the template. |
Returns
Type | Description |
---|---|
TemplateInfo | Template info |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SavePrivacyReport(String, String, Int32)
Generates a Pdf from HTML and makes a document
Declaration
int SavePrivacyReport(string htmlReport, string title, int personId)
Parameters
Type | Name | Description |
---|---|---|
String | htmlReport | Html to convert |
String | title | Title of report |
Int32 | personId | Person id associated with the report |
Returns
Type | Description |
---|---|
Int32 | Document id of saved report |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SavePrivacyReportPdf(Stream, String, Int32)
Saves a pdf stream, assigns file name, connects to given contact etc.
Declaration
int SavePrivacyReportPdf(Stream stream, string title, int personId)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The pdf document as a stream. |
String | title | Title of report |
Int32 | personId | Person id associated with the report |
Returns
Type | Description |
---|---|
Int32 | Document id of saved report |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SaveSuggestedDocumentEntity(SuggestedDocumentEntity)
Updates the existing SuggestedDocumentEntity or creates a new SuggestedDocumentEntity if the id parameter is empty
Declaration
SuggestedDocumentEntity SaveSuggestedDocumentEntity(SuggestedDocumentEntity suggestedDocumentEntity)
Parameters
Type | Name | Description |
---|---|---|
SuggestedDocumentEntity | suggestedDocumentEntity | The SuggestedDocumentEntity that is saved. |
Returns
Type | Description |
---|---|
SuggestedDocumentEntity | New or updated SuggestedDocumentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SetDocumentStream(DocumentEntity, Stream, Boolean)
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. The client should not assume that any earlier, cached entity information is valid.
Declaration
DocumentEntity SetDocumentStream(DocumentEntity documentEntity, Stream stream, bool overwriteExistingData)
Parameters
Type | Name | Description |
---|---|---|
DocumentEntity | documentEntity | The document entity object that the binary data (document) should be stored to. Its file name may be amended by this call, see the return value |
Stream | stream | The document as a stream. |
Boolean | overwriteExistingData | If true, the stream will overwrite existing data stored for this record in the document archive; this works only for documents that already have a physical document in existence. If false, the call will only work for a document that has no physical document in the archive, and such a physical document will be created. |
Returns
Type | Description |
---|---|
DocumentEntity | 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
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SetDocumentStreamFromId(Int32, Stream)
Store 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. The client should not assume that any earlier, cached entity information is valid.
Declaration
DocumentEntity SetDocumentStreamFromId(int documentId, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The document entity object that the binary data (document) should be stored to. Its file name may be amended by this call, see the return value. |
Stream | stream | The document content as a stream. |
Returns
Type | Description |
---|---|
DocumentEntity | 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
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SetTemplateStream(String, Boolean, Stream)
Save a mail signature template to the document archive
Declaration
void SetTemplateStream(string filename, bool personal, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
String | filename | Filename of template. |
Boolean | personal | If true, save the template in the user area, instead of in shared template area. |
Stream | stream | The signature template content as a stream. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteMergeDocumentTemplateVariables(Int32, Int32, String[], String[])
Parse the source document, and replace any template variable tags with their values, based on the associate Id.<p/> The source document should be of type MergeDraft. 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
Stream SubstituteMergeDocumentTemplateVariables(int documentId, int associateId, string[] customTags, string[] customValues)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The document id that refers to the binary data (document) |
Int32 | associateId | The associateId used to subsitute tags in the document. |
String[] | customTags | Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
String[] | customValues | Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
Returns
Type | Description |
---|---|
Stream | The document as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteMergeDocumentTemplateVariables2(Int32, Int32, StringDictionary)
Parse the source document, and replace any template variable tags with their values, based on the associate Id.<p/> The source document should be of type MergeDraft. 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
Stream SubstituteMergeDocumentTemplateVariables2(int documentId, int associateId, StringDictionary customTags)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The document id that refers to the binary data (document) |
Int32 | associateId | The associateId used to subsitute tags in the document. |
StringDictionary | customTags | Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag. |
Returns
Type | Description |
---|---|
Stream | The document as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteMergeDocumentTemplateVariablesEx(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, String[], String[])
Parse the source document, and replace any template variable tags with their values, based on the provided identifiers.<p/> The source document should be of type MergeDraft. 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
Stream SubstituteMergeDocumentTemplateVariablesEx(int mergeDocumentId, int contactId, int personId, int projectId, int selectionId, int appointmentId, int documentId, int saleId, string[] customTags, string[] customValues)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mergeDocumentId | The document id that refers to the binary data (document) |
Int32 | contactId | The contact identifier to use for template substitution |
Int32 | personId | The person identifier to use for template substitution |
Int32 | projectId | The project identifier to use for template substitution |
Int32 | selectionId | The selection identifier to use for template substitution |
Int32 | appointmentId | The appointment identifier to use for template substitution |
Int32 | documentId | The document identifier to use for template substitution |
Int32 | saleId | The sale identifier to use for template substitution |
String[] | customTags | Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
String[] | customValues | Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
Returns
Type | Description |
---|---|
Stream | The document as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteMergeDocumentTemplateVariablesEx2(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, StringDictionary)
Parse the source document, and replace any template variable tags with their values, based on the provided identifiers.<p/> The source document should be of type MergeDraft. 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
Stream SubstituteMergeDocumentTemplateVariablesEx2(int mergeDocumentId, int contactId, int personId, int projectId, int selectionId, int appointmentId, int documentId, int saleId, StringDictionary customTags)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mergeDocumentId | The document id that refers to the binary data (document) |
Int32 | contactId | The contact identifier to use for template substitution |
Int32 | personId | The person identifier to use for template substitution |
Int32 | projectId | The project identifier to use for template substitution |
Int32 | selectionId | The selection identifier to use for template substitution |
Int32 | appointmentId | The appointment identifier to use for template substitution |
Int32 | documentId | The document identifier to use for template substitution |
Int32 | saleId | The sale identifier to use for template substitution |
StringDictionary | customTags | Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag |
Returns
Type | Description |
---|---|
Stream | The document as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteTemplateVariables(String, GeneratorEncoding, Int32, Int32, Int32, Int32, Int32, Int32, Int32, String)
Parse the source string, and replace any template variable tags with their values, based on the ID's given in the other parameters.
Declaration
string SubstituteTemplateVariables(string source, GeneratorEncoding generatorEncoding, int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string cultureName)
Parameters
Type | Name | Description |
---|---|---|
String | source | Source string to parse for template variables. Such variables must have delimiters corresponding to the standard for the given generator encoding.<p/>Non-text source data (such as the binary content of a .doc file) should be passed in as Base64. |
GeneratorEncoding | generatorEncoding | Encoding of source string. Non-text formats such as MsWord or Excel should be Base64 encoded in the source string. |
Int32 | contactId | Identifier for a contact |
Int32 | personId | Identifier for a person |
Int32 | appointmentId | Identifier for an appointment |
Int32 | documentId | Identifier for a document |
Int32 | saleId | Identifier for a sale |
Int32 | selectionId | Identifier for a selection |
Int32 | projectId | Identifier for a project |
String | cultureName | Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server). |
Returns
Type | Description |
---|---|
String | Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64). |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteTemplateVariablesEx(TemplateVariablesParameters)
Parse the source string, and replace any template variable tags with their values, based on the identities, custom values and entities specified in the other parameters.
Declaration
string SubstituteTemplateVariablesEx(TemplateVariablesParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
TemplateVariablesParameters | parameters | Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server). |
Returns
Type | Description |
---|---|
String | Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64). |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteTemplateVariablesWithCustomTags(String, GeneratorEncoding, String[], String[], Int32, Int32, Int32, Int32, Int32, Int32, Int32, String)
Parse the source string, and replace any template variable tags with their values, based on the ID's given in the other parameters.<p/>This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.
Declaration
string SubstituteTemplateVariablesWithCustomTags(string source, GeneratorEncoding generatorEncoding, string[] customTags, string[] customValues, int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string cultureName)
Parameters
Type | Name | Description |
---|---|---|
String | source | Source string to parse for template variables. Such variables must have delimiters corresponding to the standard for the given generator encoding.<p/>Non-text source data (such as the binary content of a .doc file) should be passed in as Base64. |
GeneratorEncoding | generatorEncoding | Encoding of source string. Non-text formats such as MsWord or Excel should be Base64 encoded in the source string. |
String[] | customTags | Array of custom tag names. Each name should have exactly four characters. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
String[] | customValues | Array of values for custom tags. There should be exactly one value for each tag, i.e., the lengths of the customTags and customValues arrays should be the same. |
Int32 | contactId | Identifier for a contact |
Int32 | personId | Identifier for a person |
Int32 | appointmentId | Identifier for an appointment |
Int32 | documentId | Identifier for a document |
Int32 | saleId | Identifier for a sale |
Int32 | selectionId | Identifier for a selection |
Int32 | projectId | Identifier for a project |
String | cultureName | Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server). |
Returns
Type | Description |
---|---|
String | Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64). |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
SubstituteTemplateVariablesWithCustomTags2(String, GeneratorEncoding, StringDictionary, Int32, Int32, Int32, Int32, Int32, Int32, Int32, String)
Parse the source string, and replace any template variable tags with their values, based on the ID's given in the other parameters.<p/>This method also takes a pair of arrays specifying custom tags and their values; these tags will be available during substitution in addition to all the existing tags. Custom values will override values otherwise set.
Declaration
string SubstituteTemplateVariablesWithCustomTags2(string source, GeneratorEncoding generatorEncoding, StringDictionary customTags, int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId, string cultureName)
Parameters
Type | Name | Description |
---|---|---|
String | source | Source string to parse for template variables. Such variables must have delimiters corresponding to the standard for the given generator encoding.<p/>Non-text source data (such as the binary content of a .doc file) should be passed in as Base64. |
GeneratorEncoding | generatorEncoding | Encoding of source string. Non-text formats such as MsWord or Excel should be Base64 encoded in the source string. |
StringDictionary | customTags | Dictionary of custom tag names and values. Each name should have exactly four characters. There should be exactly one value for each tag. |
Int32 | contactId | Identifier for a contact |
Int32 | personId | Identifier for a person |
Int32 | appointmentId | Identifier for an appointment |
Int32 | documentId | Identifier for a document |
Int32 | saleId | Identifier for a sale |
Int32 | selectionId | Identifier for a selection |
Int32 | projectId | Identifier for a project |
String | cultureName | Name of culture to be used for culture-sensitive data, such as dates or multi-language texts. Use a blank string to accept whatever current culture is set on the server (possibly not a good choice in multinational organizations with a single server). |
Returns
Type | Description |
---|---|
String | Source string with templates substituted, using the same encoding as for the source (binary data will be returned in Base64). |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
UndoCheckoutDocument(Int32, String[])
Undo (abandon) a checkout
Declaration
ReturnInfo UndoCheckoutDocument(int documentId, string[] allowedReturnTypes)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | SuperOffice document ID |
String[] | allowedReturnTypes | List of return types that the client is prepared to handle, in case the document plugin needs to request additional processing.<br/>Standard allowed return types include 'None', 'Message', 'SoProtocol', 'CustomGui', 'Other'.<br/>An empty array implies that the client places no restriction on possible return action requests. |
Returns
Type | Description |
---|---|
ReturnInfo | Return information, including possible requests for further processing ("Return Action"). Return actions are constrained by the allowedReturnTypes parameter. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
ValidateDocumentEntity(DocumentEntity)
Check that entity is ready for saving, return error messages by field.
Declaration
StringDictionary ValidateDocumentEntity(DocumentEntity documentEntity)
Parameters
Type | Name | Description |
---|---|---|
DocumentEntity | documentEntity | Entity to be checked for errors. |
Returns
Type | Description |
---|---|
StringDictionary | Error messages tagged by field. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}
VerifyGetDocumentStream(Int32)
Verify that the requested document stream exists, and that we can access it, without actually getting the stream.
Declaration
void VerifyGetDocumentStream(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The document id that refers to the binary data (document) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DocumentAgent agent = new DocumentAgent())
{
// call methods on agent here...
}
}