Click or drag to resize

IDocument Interface

Documents represent files (usually Word documents or e-mail messages). The file should be generated before it can be edited/viewed

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
public interface IDocument : IModelBase

The IDocument type exposes the following members.

Properties
  NameDescription
Public propertyActiveLinks
ActiveLinks - Number of active links to documents, projects, Urls, appointments, sales, contacts, persons, selections
Public propertyCode exampleActivityLinks
The ActivityLinks attached to this document
Public propertyCode exampleapplication
Application used for editing this document. Not used. You may start other applications from CRM 5, and create documents with these other applications. For a document created in an external application, this property returns a reference to the application needed to open the document
Public propertyCode exampleArchiveProvider
Archive system where the document content is stored. You may start other applications from CRM 5, and create “documents” with these other applications. For a document created in an external application, this property returns a reference to the application needed to open the document, 0 is the SO_arc document plugin. Used with the new document plugin
Public propertyCode exampleArchiveProviderName
Archive provider name. Which system the document content is stored in. You may start other applications from CRM 5, and create “documents” with these other applications. For a document created in an external application, this property returns a reference to the application needed to open the document, 0 is the SO_arc document plugin. Used with the new document plugin
Public propertyCode exampleAssociate
Author/owner of document The document owner - in most cases this is the associate who created the document. The associate.loginname is used in the path to open the document (SO_arc\LoginName<Timeperiod><FileName>
Public propertyCode exampleAttention
Attention Attention is shown in the Document dialog as the person the document is written to. This must be a contact person registered for the current contact, but it does not mean however that a contact person is required in order to write a document
Public propertyAutoSaveOnChangeIdentity
Should the model save on IdentityChanged?
Public propertyAutoSaveOnFlush
Should the model save on flush cache?
Public propertyCode exampleChanged
has record been changed since read? If the document has modified, this will return false
Public propertyCode exampleCompleted
Is Completed A document that has not yet been completed will always be displayed in the owning associate’s diary. If the “do by” date has passed, it will appear in the Checklist even if it had a time stamp. See the database manual for more information regarding appointments shown in the Checklist or the Diary
Public propertyCode exampleContact
Contact this document refers to. The contact the document is written to. The document record is saved under this company in the CRM 5 client
Public propertyCode exampleCreatedAssociate
The user that created the object The owner of the document, the associate whose checklist the document is in shown in if the document is not set to completed
Public propertyCode exampleCreatedDate
The date the object was saved to the database. The date and time the appointment was first created
Public propertyCode exampleDescription
Description - keywords Displayed in the Document dialog as keywords, just below subject. Used for giving a more complete description of the content of the document. This field is FreeText word indexed, so you find it using the FreeText search
Public propertyCode exampleDone
Done date The date + start time this document was set as completed. By default, this will be the same as the CreatedDate, but in CRM5 you have the possibility to set a document as not completed. In those cases, the done date would differ from the CreatedDate
Public propertyExternalFieldChanged
Have external fields been changed? If set then the model will save even if no internal fields have been modified.
Public propertyExtRef
External Reference - identity in document archive system.
Public propertyCode examplefilename
Filename - does not include path The documents filename - as it is saved in the document archive. The filename is used in the path to open the document (SO_arc<SOAssociate.LoginName><Timeperiod><FileName>
Public propertyCode exampleForeignKey
ForeignKey Get the foreign key values for this document.
Public propertyCode exampleFullPath
FullPath - path and filename FullPath - path and filename for the document object
Public propertyCode exampleGroup
Primary usergroup of the owning associate - set implicitly when Associate is set
Public propertyCode exampleHeader
Title of document. Changing this does not change the document after the document has been created. The subject line of the document, as shown in the Document dialog
Public propertyCode exampleIdentity
The primary key on the primary table. Is zero for new objects. Is set when an object is saved. The document’s identity is its unique internal identity. Note that all document records will have a corresponding appointment_id, See the database manual for more information regarding appointments and documents
Public propertyCode exampleIsAvailable
is record available in db? Checks if the record is available in the database. It’s useful to check if a document actually exists before adding new properties to it
Public propertyIsFavourite
Add/Remove this document from my favourites
Public propertyCode exampleIsRequiredFilled
Are all the required fields filled out? Can we save the record? Checks if all properties that are required in this model is filled
Public propertyCode exampleIsValid
does the record exist? To save time, we don’t load a record into buffer before one of its properties is asked for. This checks if the requested record is available in buffer
Public propertyCode exampleOurRef
Our Reference - this is usually set auto-generated. Our reference as shown in the Document dialog. The field is searchable using Freetext search
Public propertyCode examplePerson
Person this document refers to. The same person as returned as a string in the Attention property, but here it’s returned as a SOPerson object. This must be a contact person registered for the current contact, but this does not mean that a contact person is required in order to write a document
Public propertyCode examplePrivate
Visible for who? 0=public,1=private,2=group The private flag specifies who is allowed to see this document
Public propertyCode examplePrivateToGroup
The group this document is visible for when Private=Group The private flag specifies who is allowed to see this document
Public propertyCode exampleProject
Project this document refers to A document may also be connected to a project, so you see the document both on the company card, and on the project card. This does not mean that a project is required
Public propertyCode examplePublishType
Publish type for this document
Public propertyCode exampleReference
External Reference - can be used for an external identifier like an e-mail Message-id Reference will be used for implementing an external document archive. Then the Notes ID, email ID or other archive provider IDs will be stored here
Public propertySale
Sale this document refers to
Public propertySalutation
Salutation - this is a dynamically calculated field!
Public propertyCode exampleSearchName
SearchName This is not implemented in CRM SIX, for later use
Public propertyCode exampleSentry
Sentry settings for this object. Lets you find out your read/write access to the object.
Public propertyCode exampleStatus
Status indicates whether the document has been completed or not. Status returns the value from the appointment table relating to the document objects status, e.g. completed, started& All documents have a record in the appointment table with a document_id > 0. See the database manual for more information
Public propertySuggestedDocumentId
Gets the suggested document id
Public propertyCode exampleTemplate
Document Template The template a document is based on is stored in the SO_arc\template folder on the server. This will return the name as displayed in the GUI, and not the physical document name, of the template the document object is based on
Public propertyCode exampleType
Type distinguishes different kinds of documents: 4 = document, 8=draft, 9=mergedoc All documents have a record in the appointment table with a document_id > 0. This property returns the type value as recorded in the appointment table. All documents have type = 4
Public propertyCode exampleUDef
The user-defined fields on the document
Public propertyCode exampleUpdatedAssociate
The last user to modify the object The last associate that updated this document. If the document has never been updated, this will return 0
Public propertyCode exampleUpdatedDate
The date of the most recent update. The date and time the appointment was last edited. If the appointment has never been updated; this will return 0, formatted as a SuperOffice date (see the database manual), this will return 01.01.1970
Public propertyValidationMessage
Get validation message, if empty model will think it is ok to save
Public propertyCode exampleYourRef
Your Reference The text entered in the Your ref field in the Document dialog
Top
Methods
  NameDescription
Public methodCode exampleCancelChanges
Undo any changes made since the object was loaded. If you made changes to the model that you don’t want to be saved to the database, call the CancelChanges method
Public methodCode exampleChangeIdentity
Loads a different record into the object. Causes changes to the existing object to be saved first. Saves the changes made to the document model to the database. The last thing you do to an object if you want the changes you made to be saved. The ChangeIdentity method calls the save method first
Public methodClone
Clone this document
Public methodCode exampleDelete
Delete the object from the database. May throw an error if you are not allowed to delete the object. Deletes the specified document model from the database. When you programmatically delete a document model, the physical file is not deleted from the document archive
Public methodCode exampleGenerateDocumentFile
GenerateDocumentFile - copies the template and substitutes the given contact/person/project values. Returns false on failure. Creates a document and does the tag substitutions (template variables) according to the properties set on the document object. Will generate a filename based on the contact and template type if the target path is blank. Will use the correct file in the template directory in SO_ARC if the templateSource is blank. Copies the template and substitutes the given contact/person/project values
Public methodCode exampleGetFileCopy
make a copy of the file and return the path Make a copy of a file, and return the path to it. Used by document plugin, gives you the possibility to force e.g. Notes to put the document on a disk where other may access it
Public methodIsSuggestedItem
Is this document used as a suggested document?
Public methodCode exampleReplaceFile
ReplaceFile - archive the file provided and update record if necessary, or replace contents of existing file with same name, or

There are three different scenarios:

  • The document record exists but filename is empty. The file is saved and the document record is updated with files name

  • The document record exists but not the file. File is saved with name from document record.

  • The document record and file exists. If the content of the files differs the existing content is

Public methodCode exampleSave
Persist the object to the database. May throw an error if you are not allowed to save changes to the object. Saves the changes you made to the document model to the database, does not return the new data from the database
Public methodCode exampleSetDefaults
Populate the object with default values, such as setting the owner to the current user. Uses the UserPreferences table to set the predefined default settings for a document. The SetDefaults method is only available for current objects in this version of SuperOfficeDB Type Library
Public methodSuggestedItemId
Get the suggested item id
Top
See Also