Click or drag to resize

ICommenceDatabase Methods

The ICommenceDatabase type exposes the following members.

Methods
  NameDescription
Public methodAddItem
Adds the indicated Item to the Category. Fields other than the Name field are set to their default values. (Default values for date fields must not specify date ranges, e.g., "every day"). By default, the new item is local (i.e., non-shared) CAUTION: If the Category has mandatory fields, those fields must be filled in with subsequent EditItem commands. Use the GetFieldDefinition request to determine which fields are mandatory. Unpredictable results may follow if mandatory fields are left unfilled. Note: If a clarify field is defined for the category (but is not a Sequence Number field), the clarify field value can be specified using the optional third parameter, Clarify Value. Alternatively, the Item parameter can be a clarified item name. If the clarify field is a Sequence Number field, then the field value is determined automatically by Commence. An error results if the AddItem REQUEST tries to set a Sequence Number field. Use GetFieldDefinition to determine the Sequence Number field value so a clarified item name can be used with subsequent EditItems.
Public methodAddSharedItem
Identical in function to AddItem except that it creates a shared item, provided that the database is connected and the category is shared. Otherwise a local item is created. CAUTION: If the Category has mandatory fields, those fields must be filled in with subsequent EditItem commands. Use the GetFieldDefinition request to determine which fields are mandatory. Unpredictable results may follow if mandatory fields are left unfilled.
Public methodAppendText
Appends text to an existing text Field. Use this command to overcome the 256 character maximum string limitation of certain macro languages (such as WordBasic). Whenever possible, use a clarified item name. You are strongly advised to use a ICommenceEditRowSet for editing fields instead.

When an item was just created with AddItem(String, String, String) or AddSharedItem(String, String, String), this is the item that will be used for appending. Otherwise, unless you specifically mark an item (using GetMarkItem(String, String, String) or MarkActiveItem(String)) the first match will be used.

Public methodAssignConnection
Assigns a connection between two items.
Public methodCheckInFormScript
Updates the detail form script with the text in the specified Filename.
Public methodCheckOutFormScript
Saves the detail form script to file.
Public methodClarifyItemNames
Specifies whether Commence should return clarified item names, or leave bStatus empty to get the current status.
Public methodClose
Close any references to Commence. The object should be disposed after this.
Public methodDeleteItem
Deletes the indicated Item from the Category. This action cannot be undone. Whenever possible, use a clarified item name.
Public methodDeleteView
Deletes the specified view. Use with caution! This action cannot be undone.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
Public methodEditItem
Sets the value of Field to Value for the item identified by Item in Category. Field must not specify a Calculation field. Date fields may not specify a range, (e.g., "every day"). Whenever possible, use a clarified Item name.
Public methodExportDatabaseSchema
Exports the schema information to file. Defaults to Json.
Public methodFieldValueExists
Checks to see if value is already present for given field.
Public methodCode exampleFireTrigger
Fires the indicated Agent Trigger.
Public methodGetActiveCategory
Gets the category of the active item or view.
Public methodGetActiveItemName
Gets the itemname of the active item. Use MarkActiveItem(String) to try and get a clariefied itemname.
Public methodGetActiveViewInfo
Returms information on the currently active view (if any).
Public methodGetCallerID(String, String)
Returns a list of all items in the Category having the given phone number in a phone field. If Category is blank, searches all categories in the currently active database
Public methodGetCallerID(String, String, String)
Returns a list of all items in the Category having the given phone number in a phone field. If Category is blank, searches all categories in the currently active database
Public methodGetCategoryCount
Returns number of categories in the Commence database.
Public methodGetCategoryDefinition
Returns information on the definition of the specified category.
Public methodGetCategoryNames
Gets a list of categories in the current Commence database.
Public methodGetCategoryNames(String)
Gets a list of category names.
Public methodGetClarifiedItemName
Construct a clarified item name from the unclarified itemname, the clarify separator and the clarify value
Public methodGetClarifyField
Gets the clarifyfield for the specified category.
Public methodGetClarifySeparator
Gets the clarify separator for the specified category.
Public methodGetConnectedItemCount
Gets the number of connected items in connected category for the specified item
Public methodGetConnectedItemField
Returns the indirect field value(s) in connCategory that itemName of the categoryName is connected to via Connection. The order of the items in the list is arbitrary (i.e., not sorted).
Public methodGetConnectedItemNames(String, String, String, String)
Gets a list of items connected to the specified item.
Public methodGetConnectedItemNames(String, String, String, String, String)
Returns the list of items in category that named item is connected to. The order of the items in the list is arbitrary (i.e., not sorted).
Public methodGetConnectionCount
Gets the number of connections from the specified category.
Public methodGetConnectionNames(String)
Gets a list of connection names to the specified category.
Public methodGetConnectionNames(String, String, String)
Gets the connection names for the specified category.
Public methodGetCursor
Create a cursor.
Public methodGetDatabase Obsolete.
(Not implemented) Get the active Commence database name and path as delimited string. See Name and/or Path.
Public methodGetDatabaseDefinition
Queries Commence for information on the database definition.
Public methodGetDatabaseSchema
Gets a serializable object containnig the Commence schema definition.
Public methodGetDesktopCount
Gets the number of Desktops in the Commence database.
Public methodGetDesktopNames
Get a list of desktopnames.
Public methodGetDesktopNames(String)
Gets the desktop names in the Commence database.
Public methodGetField
Returns a fieldvalue from the specified Commence item.
Public methodGetFieldCount
Gets the number of fields in the specified category.
Public methodGetFieldDefinition
Queries Commence for information on the specified field definition.
Public methodGetFieldNames(String)
Gets a list of fieldnames for the specified Commence category.
Public methodGetFieldNames(String, String)
Gets the fieldnames for the specified category.
Public methodGetFields(String, String, ListString)
Gets values of specified field(s) from specified item.
Public methodGetFields(String, String, Object, String)
Gets values of specified field(s) from specified item.
Public methodGetFieldToFile
Writes a single fieldvalue to file.
Public methodGetFormCount
Gets the number of Item Detail Forms for the specified category.
Public methodGetFormNames(String)
Gets a list of all Item Detail Form names in specified category.
Public methodGetFormNames(String, String)
Gets the Item detail Form names for the specified category
Public methodGetImageFieldCount
Gets the number of image fields in specified category.
Public methodGetImageFieldNames(String)
Gets a list of all field of type 'image' from the specified category.
Public methodGetImageFieldNames(String, String)
Gets the image-type field names for the specified category.
Public methodGetImageFieldToFile
Copies the image field identified by the named Category, Item, and Field to the specified Filename. Only bitmap (.BMP) format image fields are currently supported. Filename must be a fully qualified path including the drive letter (e.g. c:\tmp\data.bmp). If the file does not exist, Commence will create it; the drive and directory, however, must already exist. If the file exists, it will be overwritten. It is the client’s responsibility to perform the necessary file cleanup. If the image field is blank, no file is written.
Public methodGetItemCount
Gets the number of items in the specified category.
Public methodGetItemNames(String)
Gets a list of all itemnames in the specified category.
Public methodGetItemNames(String, String)
Gets the item names for the specified category
Public methodGetLastError
Gets the last error that occurred during DDE conversation. Inspect this value if a call failed.
Public methodGetLetterViewInfo
Returns information about the active view and selected letter template at the time the Tools-Send Letter or Customize-Database-Letter Template command was executed. This call is used by the Commence letter macros and has not been implemented here.
Public methodGetMarkItem
"Marks" the specified item and makes it the default category and item for subsequent calls to: EditItem, DeleteItem, AppendText, AssignConnection, UnassignConnection, PromoteItemToShared and ShowItem EXECUTE commands, and GetField, GetFieldToFile, GetFields, GetConnectedItemCount and GetConnectedItemNames REQUESTS. The category and item is marked only for the specific DDE conversation, not globally. that is, each DDE conversation can have a different marked item. Can be used to mark the (-Me-) item if one is defined. Syntax: [GetMarkItem("(-Me-)")] Note: If a Clarify Field is defined for the category, the value of the clarify field can be specified with an optional third paramter. Alternatively, the ItemName can be a clarified item name.
Public methodGetMeField
Gets a fieldvalue from the item defined as (-Me-) item in Commence.
Public methodGetNameField
Get the name of the namefield for the specified category.
Public methodGetPhoneNumber
TAPI must be configured for GetPhoneNumber to work properly. TAPI is ancient, so this method is not implemented.
Public methodGetPreference
Get preference settings.
Public methodGetReverseName
Uses Commence preference information and reverses the name if appropriate.
Public methodGetTriggerCount
Gets the number of DDE agent triggers defined in the database.
Public methodGetTriggerNames
Get a list of Agent triggers.
Public methodGetTriggerNames(String)
Gets the trigger names defined in the database.
Public methodGetViewColumnNames
Gets the columnnames from a view provided a cursor can be created on them.
Public methodGetViewCount
Gets the number of views in the specified category.
Public methodGetViewDefinition
Get definition of a view
Public methodGetViewNames(String)
Gets a list of all views for the specified category. Returns all categories if category is not specified.
Public methodGetViewNames(String, String)
Gets a list of view names for the specified category.
Public methodGetViewToFile
Saves the Commence View to a file in HTML format (similar to the File-Save As HTML menu command). If the file does not exist, Commence will create it; the drive and directory must exist. If the file exists, it will be overwritten.
Public methodHasDuplicates
Checks if field contains duplicate values.
Public methodLogPhoneCall
Launches an add tem detail window for an item in the Phone Log category (as specified in the Commence Customize-Preferences-Event Logs dialog box). One or more Category/Item pairs may be given as arguments; connections will be set between the new Phone Log item and these items. If no connection exists between the two categories, the pair is ignored and no error is given. The connection is set via all connections found between the two categories. If no Phone Log category is set, NACK error code 104 (DDE_ERROR_NOLOGCLASS) is returned. If there is no room to add an item in the Phone Log category, NACK error code 112 (DDE_ERROR_FULL) is returned.
Public methodMarkActiveItem
Marks the active item for subsequent requests.
Public methodMergeTemplateCreate
Creates a new template with the given parameters. If template exists, the call fails. This call returns the template filename assigned by Commence, including the full path and extension configured in Preferences-Letter dialog.
Public methodMergeTemplateSave
Updates an existing template identified by the name parameter. Template must exist, else the call fails.
Public methodPromoteItemToShared
Promotes a local item to shared status, provided the database is connected and the category is shared. If the item is already shared, its status is unchanged. Note that there is no way to demote an item from shared to local status. Whenever possible, use a clarified Item name.
Public methodShowDesktop
Opens the specified desktop in Commence.
Public methodShowItem
Opens an item detail window in Commence for the given Item in the given Category. If a detail is already open for the item, it will be brought to the top and given the focus.
Public methodShowView
Opens the specified view in Commence. If the view is already open, it will become the active view.
Public methodUnassignConnection
Unassigns a connection between two items.
Public methodViewCategory
Defines the category to be used. This must be the first message sent to Commence for a ViewData conversation. ViewCategory may be sent at any time to reset the ViewData conversation state. ViewData conversation topic has been obsolete since Commence 3.0 (1995 or so), so it is extremely unlikely you will ever need this method.
Public methodViewConjunction
Defines the logical operations that link the filter clauses specified with the ViewFilter request. Each parameter can be either "And" or "Or"; the default value is "And". AndOr12 defines the relationship between the filter clauses 1 and 2, AndOr34 for clauses 3 and 4, and AndOr13 for (1 and 2) and (3 and 4), etc. Note the special significance of AndOr48, which signifies the relationship between the two groups of 4 filters.

The logical precedence is: (Filter1 AndOr12 Filter2) AndOr13 (Filter3 AndOr34 Filter4) AndOr4to8 [repeat 5 to 8]

Public methodViewConnectedCount
Returns the number of items in the connCategory that the Indexth item is connected to via ConnectionName.
Public methodViewConnectedField
Returns the value of Field of the ConnIndexth item in the connCategory that is connected to the Indexth item via ConnectionName. Use the ViewConnectedCount REQUEST to determine the maximum ConnIndex value. The string "(deleted)" will be returned if the requested item is deleted after the ViewData snapshot is taken.
Public methodViewConnectedFields(Int32, String, String, Int32, ListString, String)
Returns multiple field values (Field_1 through Field_n) in the ConnIndexth item in the connCategory that is connected to the Indexth item via ConnectionName. Use the ViewConnectedCount REQUEST to determine the maximum ConnIndex value. The string "(deleted)" will be returned if the requested item is deleted after the ViewData snapshot is taken. Field cannot be of the fieldtype Image.
Public methodViewConnectedFields(Int32, String, String, Int32, Object, String)
Returns multiple field values (Field_1 through Field_n) in the ConnIndexth item in the connCategory that is connected to the Indexth item via ConnectionName. Use the ViewConnectedCount REQUEST to determine the maximum ConnIndex value. The string "(deleted)" will be returned if the requested item is deleted after the ViewData snapshot is taken. Field cannot be of the fieldtype Image.
Public methodViewConnectedItem
Returns the ConnIndexth item in connCategory that the Indexth item is connected to via ConnectionName. Use the ViewConnectedCount REQUEST to determine the maximum ConnIndex value.
Public methodViewDeleteAllItems
USE WITH EXTREME CAUTION! Deletes all items that satisfy the currently defined filter. If no filter is defined, deletes all items in the previously named category, see ViewCategory(String). Fails without warning when no delete permissions were granted on the category.
Public methodViewField
Returns the value of Field of the Indexth item that satisfies the currently defined filter (if any). Use the ViewItemCount REQUEST to determine the maximum Index value. The string "(deleted)" will be returned if the requested item is deleted after the ViewData snapshot is taken.
Public methodViewFields(Int32, ListString, String)
Returns multiple field values (n) for the Indexth item that satisfies the currently defined filter (if any). Use the ViewItemCount request to determine that maximum Index value. Use the GetFieldNames request to determine valid field names. The string "(deleted)" will be returned if the requested item is deleted after the ViewData snapshot is taken. Image type fields are not allowed in the Field_ parameters.
Public methodViewFields(Int32, Object, String)
Returns multiple field values (n) for the Indexth item that satisfies the currently defined filter (if any). Use the ViewItemCount request to determine that maximum Index value. Use the GetFieldNames request to determine valid field names. The string "(deleted)" will be returned if the requested item is deleted after the ViewData snapshot is taken. Image type fields are not allowed in the Field_ parameters.
Public methodViewFieldToFile
Saves specified field to file
Public methodViewFilter
Defines the criteria for the multiple filter to be applied against the previously named category/view (see ViewCategory/ViewView). This is by far the most complicated API method to use. Unless you are actually creating views from code, you are strongly advised to use the Filters collection of the CommenceCursor class instead.
Public methodViewImageFieldToFile
Copies the image field data in Field from the Indexth item that satisfies the currently defined filter (if any) to the specified Filename.
Public methodViewItemCount
Returns the number of items that satisfy the currently defined filter (if any). If no filter is defined, this request returns the total number of items in the category
Public methodViewItemIndex
Returns the index of the item with the indicated name field value. The item must also satisfy the currently defined filter (if any). Use a clarified itemname if possible. Note: If the NameFieldValue is left blank, the marked item will be used. Returns the index of the marked item (if any).
Public methodViewItemName
Returns the itemname for the Indexth item. Different from ViewField(Index, Name) in that a clarified item name may be returned. The ClarifyItemNames request is used to enable or disable the use of clarified item names.
Public methodViewMarkItem
Marks the Indexth item in the view and makes it the default category and item for the EditItem, AppendText, AssignConnection, UnassignConnection, PromoteItemToShared and ShowItem EXECUTE commands.
Public methodViewReverseName
Uses Commence preference information and reverses the name if appropriate.
Public methodViewSaveView
Saves the virtual DDE view already created with the ViewCategory, ViewFilter, ViewSort, etc., as an actual view in Commence, accessible via the normal user interface. The view will be saved using the specified New View Name. If the view already exists, it will be overwritten. Use GetViewNames to determine if the view name conflicts with an existing view.
Public methodViewSort
Defines the sort criteria for the view. Field1, Field2, Field3, and Field4 define the fields to sort by. Sort1, Sort2, Sort3, and Sort4 define the sort type and should be "Ascending" or "Descending". Unused sort pairs (i.e. FieldN, SortN) may be omitted.
Public methodViewView
Uses the category and filter criteria of a Commence View that has already be defined from the Commence menu interface. The ViewView REQUEST overrides any previously received ViewCategory, ViewConjunction, ViewFilter, and ViewSort REQUESTS. If the ViewName parameter is left blank, the active view will be used.
Top
See Also