Click or drag to resize

IDocument Methods

The IDocument type exposes the following members.

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