Previous Topic

Next Topic

Book Contents

Book Index

Automation in bcdDocuments

This section is for those wanting to use a program or macro to take data out of or put data into the bcdDocuments database, or to perform some action using bcdDocuments. The section is written for someone modestly familiar with programming, such as using the Visual Basic For Applications Editor (VBA) available with MS Word. Several programming environments may be used to talk with the bcdDocuments database via the interfaces provided here.

bcdDocuments is a document production and workflow management program for professional offices. It uses a database. Many offices also use databases to manage their data. The bcdDocuments program is also an Automation Server for its database. Wherever bcdDocuments can legally run, other programs may read and write to its database by using the interfaces provided in bcdDocuments. Programs made, for example, in Embarcadero or Microsoft development environments, including those using Delphi, C++, Visual Basic and Visual Basic for Applications, including Word and Excel macros, can read from and write to the bcdDocuments database. The information in this section will assist you make programs or macros to do this.

More capabilities are being developed for bcdDocuments - Professional Automation. If you have needs not yet meet in the capabilities listed here please contact the developers.

In This Chapter

Programming examples

Terms

Interfaces

Previous Topic

Next Topic

Book Contents

Book Index

Programming examples

In the files distributed with bcdDocuments are examples using the automation interface.

When bcdDocuments was installed, files were copied to a Program Folder. The examples are in subfolders: Delphi and VBA.

The VBA example was developed in the VB editor with MS Word. The included Visual Basic files are:

BcdDocsSample.frm, bcdDocsSample.frx, bcdDocs01.vba

Depending on what kind of VB Editor you have, you may use "File – Open" to open the vba file or "File – Import File" to import the frm file.

A complete Delphi project set of files is included.

See Also

Automation in bcdDocuments

Terms

Interfaces

Previous Topic

Next Topic

Book Contents

Book Index

Terms

abs(N): If N is a positive number then abs(N) is N. If N is negative then abs(N) is –N. For example abs(0)=0, abs(7)=7 and abs(-7)=7.

Application: In bcdDocuments one can make templates or recipes for performing jobs for clients. These jobs involve making documents and performing specific tasks or events. These templates are referred to as Applications.

ApplicationId: A Positive integer being the unique identifying number of a bcdDocuments Application. Applications are recipes or templates for a packet of work.

ApplicationPacket: a string containing three items: ApplicationId, StatusID, ApplicationName.with items separated by "|", the ASCII character 124. For example "1234|2|The main application".

AssignmentDefaultSetId: a positive integer being the unique identifier of an AssignmentDefaultSet.

AssignmentDefaultSet: In bcdDocuments Matters have events and events are assigned Users who perform those events. When a Matter is made Users should be assigned to events. An list assigning Users to Events is an AssignmentDefaultSet. They can be made in bcdDocuments and used there. They can be used to make assignments when a Matter is made from another program via the interface.

BcdDocuments: This term is the name of the main executable program for the software package of the same name. The software is a document production and workflow management package for professional offices.

Client: In bcdDocuments a client is a customer of the firm using bcdDocuments.

ClientId: a positive integer being the unique identifying number of a client.

ClientPacket: a string containing three items ClientId, StatusId, ClientNam with items separated by "|", ASCII character numbered 124. For example: "1024|2|John Brown". The client has name "John Brown", their identifying number is 1024 and their status identifying number is 2, meaning ACTIVE.

DefaultDataSet: In bcdDocuments Matters use data. If an Application is made to perform the same job, such as transferring ownership to buyers of apartments in a building, some of the data used in a Matter will be common. To save entering the same data over and over again, one may use a common set of data when creating Matters for these transfers.

DefaultDataSetId: a positive integer being the unique identifier of a DefaultDataSet.

ErrorCode: A negative integer returned by a property of method indicating an error was detected. These codes can be used to get a text message indicating what error was detected.

Field or DataField : A slot or box or place in which information about a client is stored. For example a client database might have fields named TelHome, TelWork containing a client's home and work telephone numbers.

FieldId: A positive integer being the unique identifying number of a Data Field.

FieldName: the name of a Field. For example TelHome could be the name of a client's home telephone number.

FieldPacket: a string containing three items: FieldId, TypeId, FieldName with items separated by "|". For example: "43|1|TelHome". It has FieldId 32, the client field name is "TelHome" and its TypeId is 1 or TEXT.

FieldTypeID: an integer representign one of TEXT (1), FILE (2) or MEMO (3). See FieldTypes.

FILE data also consists of a single string. The meaning of FILE data is that it is the address or partial address of a file on a computer or network. For example the following strings can be FILE data:
"C:\Program Files\Microsoft Office\Signature.JPG",
"\\BigServer\sharedDrive01\Folder02\alpha.doc",
"\Folder03\subFolder04\finance.doc"

Integer: A kind or type of data being a number between -2,147,483,647 and 2,147,483,647. If you started with number one, pressed a button to add one to your current number and pressed the button once each second, it would take you more than 68 years to reach the upper limit 2147483647.

ListId: A positive integer being the unique identifying number of a List, or pick list.

ListItemPacket: a string containing two things: the data for the list item and the description of the list item. The items

ListTypePacket: a string containing two things: TypeId, ListType, separated by "|". The TypeId is an integer and the ListType is a three character code, such as "TXT", for a list of text; "CLT", for a list of clients; "MMO", for a list of memos; "DOC", for a list of documents. At present there are four list types so each ListTypePacket will be one of "1|TXT", "2|DOC", "3|CLT", "4|MMO".

ListPacket: a string containing three things: List name, list description and listI., with the item separated by "|". For example, "Advisors|List of advisors to our firm|123".

Matter or Client Matter: In bcdDocuments this is a job or work packack performed for a client and described by an Application. Data about the client and the job performed for the client is "combined" with an Application to form a Matter.
Matter = Client + Application.

MatterId: A positive integer being the unique identifying number of a Matter. A Matter is a traditional term for a specified packet of work for a client.

MatterPacket: a string containing four items: MatterId, StatusId, ApplicationId, MatterName, with the items separated by "|".

MatterAssignmenPacket: a string containing two items: the MatterAssignmentSetId and the MatterAssignmentSet name. e.g. "32,Lease Performers".

MatterDataPacket: a string containing two items: the MatterDataSetId and the MatterDataSet Name, with the items sepaated by "|". For example,. "91|Lease Data Defaults".

MEMO data consists of several strings each string being a line or paragraph of a Memo field. MEMO data when used in a document will be presented in the document on as many lines as are in the field, whereas TEXT data will be presented in one paragraph. For example the following four paragraphs can be the data in a single MEMO field:
"Mr. John Brown"
"213 Hilltop Avenue"
"Auckland 1345"
"NEW ZEALAND"

NWDSetId: A positive integer being the unique identifier of a NWDSet.

NWDSetPacket: a string containing two things: a NWDSId and the NWDSet name, with the items separated by "|". For example, "3|Default_NWDSet"

NWDSets: In bcdDocuments events may be primary or secondays events. A secondary event may be due 45 working days after its parent primary event. So a list of working days is required. Different locations have different working days, so different sets of working days may be required. A list of non-working days is a NWDSet.

SiteId: A positive integer being the unique identifying number of a Site in bcdDocuments. A Site and its data specify the details of a firm's office, such as your office in Sydney or Auckland.

String: A kind or type of data being a sequence of characters. For example, the sequence "Hello" is a string of 5 characters. A string may contain up to 32767 bytes.

StringList: A kind or type of data being a sequence of strings. For example "Hello", "and", "goodbye" is a sequence of 3 strings. If these three strings made a Memo there would be three lines in the memo. A StringList may contain up to 32767 bytes.

TEXT data consists of a single string or a single paragraph. Test data is stored as a string. For example, the following four strings can each be TEXT data:
"John Brown",
"021-123-4567",
"20 Hilltop Avenue",
"12345".

Type: the kind of data a field contains. At present the types of data are TEXT, FILE and MEMO.

UserId: A unique integer identifier for a User.

UserPacket: a string containing two things: a UserId and the name of the User with this Id, with the items separated by "|". For example, "23|wbrown". The UserId is the number of the staff member or user as registered in bcdDOcuments. The user name is also as registered with bcdDocuments and must be the user's Windows logon name.

Users: The staff in the firm using bcdDocuments who may use bcdDocuments or who perform events of Matters used in bcdDocuments.

When presented in a document a line of text may span many lines on a page but it will consist of only one paragraph

See Also

Automation in bcdDocuments

Programming examples

Interfaces

Previous Topic

Next Topic

Book Contents

Book Index

Interfaces

The terms used for the interfaces here are related to the data subsets of bcdDocuments. For information on these refer to the relevant sections in this document.

BcdDocuments uses the following interfaces:

Each of these topics has an interface or access into bcdDocuments data. Each makes available to another program a set of Properties and Methods enabling a program to read from and write to the bcdDocuments database. The Program interface allows a program to minimize or restore the bcdDocuments program and to get its version number.

Only on machines where bcdDocuments may be run and only where the user logon is registered with bcdDocuments are these interfaces available. If a user logged onto a PC can run bcdDocuments then the programs they run can use these interfaces. If the user cannot run bcdDocuments the programs they can run cannot use the interfaces. Using the interfaces requires a connection to the bcdDocuments database so a connection license must available for use.

Programming examples are given for Visual Basic (VB) and Delphi. The files required are in the Programming\VB and Programming\Delphi folders on the bcdDocuments CD. Parts of these files are given below as examples to help a programmer read the notes.

Each time a document is made from a template the following MS Word document variables and their values are place in the document being made and left there for the duration of the construction. The the document has been made, and before it is saved, these variables are removed from the document:

These document variables may be used, for example, by VBA macros called during document construction. These values can be used as input values to several methods and properties in the interfaces specified below.

In This Section

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

See Also

Automation in bcdDocuments

Programming examples

Terms

Previous Topic

Next Topic

Book Contents

Book Index

Applications interface

An application is a recipe or template, made to your firm's requirements, for doing a job for a client. When an application is used it is combined with a client into a matter for the client. The matter is used to make documents and track events.

The Properties are:

Property Name

Parameters

Return Type Value

 

Input

Output

 

Count

None

None

Integer. The number of applications in the database.

Applications

None

None

StringList. Each string is an ApplicationPacket.

The Methods are:

1. GetApplicationNotes (ApplicationId, Code) returns Notes

This method returns the Notes for the application identified by ApplicationId. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code));

2. GetApplicationDefaults (ApplicationId, DataDefaultId, PerformerDefaultId, NWDSDefaultId, SiteDefaultId) returns Code

This method accepts an applications identifier ApplicationID and returns identifiers for the default data set, performer set, nonworking day set and default site for this application. If any default is not specified -1 is returned for the missing identifier. It is not an error for an application to have no default set for either of these.

Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code));

3. GetAppNameFromID (ApplicationID, Code) returns AppName

This method returns the name of th eapplication whose identifier is ApplicationId, and returns the name of the application AppName as a string.

Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

See Also

Interfaces

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

Clients interface

In bcdDocuments clients are persons or organizations for whom tasks are performed.

The Client interface makes available properties and methods to other programs allowing them to look at and modify client related data in the bcdDocuments database.

The Properties are:

Property Name

Parameters

Return Type Value

 

Input

Output

 

Clients

None

None

StringList: Each string is a ClientPacket.

Count

None

None

Integer. The number of fields in the client database.

Fields

None

None

StringList: Each string is a FieldPacket.

FieldsCount

None

None

Integer: The number of Fields in the client database

If a negative number is returned for those Property values which are integers, an error was detected. A text message indicating the error can be retrieved using the property ErrorMsg(abs(ErrorCode)) supplied by theProgram interface.

The Methods are:

1. GetClientData(ClientId,FieldId,FieldTypeID,Code) returns Data

This method accepts a client's ClientId and the FieldId for a field in the client database and returns a StringList, a FieldTypeID and an ErrorCode. If the FieldTypeID of the field requested is TEXT (1) or FILE (2) then Data will have at most one string. If the FieldTypeID is MEMO (3) the number of lines or paragraphs returned in Data can be obtained from GetClientDataLineCount(ClientId,FieldId). The FieldID can be obtained from method GetFieldIdFormName() if you know the name of the field you want. The field names in the Client database are listed using the Fields property.

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)). A return of -3 in Code indicates the Data sought is missing.

If the requested data is missing and you have not called GetMissingClientData(0) then the data will be requested from a user. If the data is supplied it will be placed in the database and returned for this GetClientData call. If the data is not supplied then -3 will be returned in Code. If you called GetMissingClientData(0) as your last call to GetMissingClientData(..) then the missing data will not be requested and -3 will be returned in Code.

2. GetMissingClientData(YN) has no return value

GetMissingClientData(1) is the default. Making this call has this effect. When a call is made to GetClientData(...) and the requested data is missing, which is the case when the requested data has never been entered to the database, then the user will be asked to supply the data. If the data is supplied it is placed in the database and returned for the GetClientData(...) call. If it is not supplied the value of Code in the GetClientData(...) call is returned as -3.

GetMissingClientData(0) or GetMissingClientData(N) where N is not 1 has this effect. Missing data is not requested in calls to GetClientData(...) and -3 is returned in the Code value when the requested data is missing.

3. GetClientDataLineCount(ClientId, FieldId) returns Count

This method accepts a client's ClientId and the FieldId for a field in the client database and returns an integer Count, being the number of paragraphs in the Client data for this client and field. If the FieldType of the field requested is TEXT or FILE then Data will have at most one string. If the FieldType is MEMO the number of lines or paragraphs may be more than one.

If the value returned in Count is 0 then no data was found in the field.

If the value returned in Count is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Count))

4. GetClientDescription( ClientId, Code) returns ClientDescription

This method returns the description for the client identified by ClientId. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code));

5. GetClientIdFromName( aClientName) returns ClientId

This method looks for aClientName in the client database and on finding it returns ClientID, the unique identifier for the client specified by the name.

The search is case insensitive, so "bigfirm" would return the same value as "BigFirm" and "BIGFIRM". If no such client is found or an error occurs the value returned in ClientId will be negative and the corresponding error message will be ErrorMsg(abs(ClientId)), of theProgram interface.

6. CountClientsLikeName( LikeName, Code ) returns ClientsCount

This method looks for clients whose LikeName is like the input string. The input string can use wild card characters % (for any set of characters) or _ (for a single character). The returned value is the number of clients matching LikeName

The input string "Ad%" would return ClientPackets for clients with names "Adam", "Adams", and "Adzione". The input string "Be_ding" would return ClientPackets for clients with names "Belding", "Bedding", and "Bending". The client name matching is case sensitive. A case insensitive version will be implemented if there is interest in it.

Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

7. GetClientsLikeName(LikeName, Code) returns aStringList

This method looks for clients whose LikeName is like the input string. The input string can use wild card characters % (for any set of characters) or _ (for a single character). The returned string list consists of ClientPackets. If there are no wild card characters in LikeName then the ClientPacket for the specified single client is returned or ClientsCount is 0.

The input string "Ad%" would return ClientPackets for clients with names "Adam", "Adams", and "Adzione". The input string "Be_ding" would return ClientPackets for clients with names "Belding", "Bedding", and "Bending". The client name matching is case sensitive. A case insensitive version will be implemented if there is interest in it.

Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

8. GetFieldIdFromName(FieldName) returns FieldId

This method returns the FieldId for the Client database field whose name is FieldName. The method is case insensitive to the input field name. If the output value is negative an error was detected and the corresponding error message is ErrorMsg(abs(FieldId)).

9. GetClientNotes(ClientID, Code) returns Notes

This method returns the Notes for the client identified by ClientId. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

10. InsertClient(ClientName, ClientDescription) returns ClientId

This method inserts a new client with name ClientName and description ClientDescription. If the client is inserted their ClientId is returned. If ClientId is negative an error was detected and the corresponding error message is ErrorMsg(abs(ClientId)). Client names are case insensitively unique. It is not possible to have clients named "John Brown" and "JOHN BROWN" for example.

11. InsertClientData(ClientId,FieldId,Data) returns Code

This method inserts or updates information in the client database for the client identified by ClientId and the field identified by FieldId. If the FieldType of the field is TEXT or FILE then Data should contain one string. Paragraphs beyond the first paragraph will be ignored. If the type is MEMO then Data can contain many paragraphs. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

12. InsertClientDescription(ClientId, ClientDescription) returns Code

This method inserts a description for the client identified by ClientId. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

13. InsertClientNotes(ClientId, Notes) returns Code

This method inserts Notes for the client identified by ClientId. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

See Also

Interfaces

Applications interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

DocumentData interface

The DocumentData interface provides one method. This interface allows you to get data from the Matter database using the matterId and a bookmark name.

1. GetFieldData (MatterId, 0, aBookMarkName, Code) returns Data

This method accepts a MatterId, 0 and a bookmark name, as it appears in a document template and returns a StringList and an ErrorCode. The second input should be entered as the integer 0. The MatterId is the unique integer assigned to a client matter within bcdDocuments. The StringList returned is the data stored in the database for the bookmark. The bookmark will contain the information required to determine if the data field given in the bookmark is from the Client, Matter or Site database.

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)).

See Also

Interfaces

Applications interface

Clients interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

FieldTypes

This FieldTypes interface has two properties. They report the number and names of the field types. At present the field types are "TEXT" with TypeId 1, "FILE" of typeId 2, and "MEMO" with TypeId 3. Do not assume these will be the only field types as more may be added.

bcdDocuments database.

The Properties are:

Property Name

Parameters

Return Type Value

 

Input

Output

 

Count

None

None

Integer. The number of data types

Types

None

None

StringList: Each string is a TypePacket.

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

MatterAssignmentSets interface

The MatterAssignmentsSets interface has two properties. Matter Assignment Sets are sets of assignments of staff to events, made using the Data and Performer Defaults Assistant, which can be used to give a matter a default set of assignments. Their use is optional. Using them can save repetitive typing. They are specific to matters made from an Application.

The Properties are:

Property Name

Parameters

Return Type Value

 

Input

Output

 

Count

None

None

Integer. The number of MatterAssignmentSets.

MatterDataSets

None

None

StringList: Each string is a MatterAssignmentSetPacket. There will be Count strings in the StringList.

If a negative number is returned for Count an error was detected. A text message indicating the error can be retrieved using the property ErrorMsg(abs(Count)) supplied by theProgram interface.

A MatterAssignmentPacket is a string containing two things: the MatterAssignmentSetId and the MatterAssignmentSet Name. e.g. "45,Bankruptcy Assignment Defaults".

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

MatterDataSets interface

The MatterDataSets interface has two properties. Matter Data Sets are sets of data, made using the Data and Performer Defaults Assistant, which can be used to give a matter a default set of data. Their use is optional. Using them can save repetitive typing. They are specific to matters made from an Application.

The Properties are:

Property Name

Parameters

Return Type Value

 

Input

Output

 

Count

None

None

Integer. The number of MatterDataSets.

MatterDataSets

None

None

StringList: Each string is a MatterDataSetPacket. There will be Count strings in the StringList.

If a negative number is returned for Count an error was detected. A text message indicating the error can be retrieved using the property ErrorMsg(abs(Count)) supplied by theProgram interface.

A MatterDataPacket is a string containing two things: the MatterDataSetId and the MatterDataSet Name. e.g. "19,Jones Development Data Defaults".

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

MatterEvents Interface

Events are defined in Applications and used in Matters. This MatterEvents interface provides access to informations about events in matters. Each events in a matter has a presentation order, a date required, a date done (possibly null), and a performer who is to or has performed the event.

To use these methods you need to know a matter's MatterID and either the event's name of its presentation order in the events of the matter. You would use GetMatterEventID_Name or GetMatterEventID_POrder to get the MatterEventID of the events and use this value in other methods to obtain other information about the event.

This interface allows you to obtain information about events, their dates and their performers to be used, for example, in other Microsoft Office applications, such as Outlook, Excel and Access.

The Methods are:

1. GetMatterEventID_POrder (MatterId, POrder, Code) returns MatterEventID

This method takes a matter's ID and the presentation Order POrder of an event and returns the MatterEventID of the event of this matter. The MatterEventID is used to identify the event to other methods lists below. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

2. GetMatterEventID_Name (MatterId, EventName, Code) returns MatterEventID

This method takes a matter's ID and the name or description of an event and returns the MatterEventID of the event of this matter. The MatterEventID is used to identify the event to other methods lists below. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

3. GetEventAppData(MatterEventID, AppID, AppEventID, ParentAppEventID) returns Code

This method takes the MatterEventID of a matter event and returns the ID of the application on which the matter is based, AppID; the ID of the event in the application, AppEventID; and the ID in the application of its parent event, if any, ParentAppEventID. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

4. GetEventActive(MatterEventID, Active) returns Code

This method takes the MatterEventID of a matter event and returns Active as 1 if the event is active in its matter or 0 if the event is inactive in its matter. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

5. GetEventPerformerID(MatterEventID, PerformerID) returns Code

This method takes the MatterEventID of a matter event and returns the ID of the performer of this event, PerformerID, the ID of the staff member or User responsible for this event. Staff members (or performers or users are entered in the Staff Assistant. The PerformerID values can be used in methods of the UserInterface. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

6. GetEventPerformerName(MatterEventID, Code) returns Name

This method takes the MatterEventID of a matter event and returns the name of the performer of this event, Name. Staff members (or performers or users are entered in the Staff Assistant. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

7. GetEventTypeID(MatterEventID,TypeID) returns Code

This method takes the MatterEventID of a matter event and returns the ID of the type of this event, TypeID, the ID of the type of this event. Event types are defined for each bcdDocuments installation in the Event Type Assistant. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

8. GetEventTypeName(MatterEventID, Code) returns Name

This method takes the MatterEventID of a matter event and returns the name of the event type of this event, Name. Event type names are defined for each bcdDocuments installation using the Event Types Assistant. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

9. GetEventDates(MatterEventID, DateReqd, DateDone) returns Code

This method takes the MatterEventID of a matter event and returns the two dates for the event: the date the event is required, DateReqd; and the date the event was done, DateDone. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

Any missing date will be reported as a date before 1 January 2000 and will result in a negative Code return, so checking the returned dates is the first step in checking the date's validity.

10 GetEventName(MatterID, Code) returns Name

This method takes the MatterEventID of a matter event and returns the event name. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

11. GetEventDocID(MatterEventID, DocID) returns Code

This method takes the MatterEventID of a matter event and returns the ID of the document template used in the event, if any. If the event does not make a document the returned DocID wil be 0. Code is returned as an argument and if negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

Matters interface

A matter is a job to be performed for a client according to the template or recipe in an application.
This is expressed as: Application + Client = Matter.

The methods are

1. GetMattersCount (OptionId, Id) returns aCount

This method returns the number of matters for six cases, listed below, depending on the values for OptionId and Id. If the return value is negative then an error has been detected and the error message is available from ErrorMsg(abs(aCount)). This method is in the Program interface.

OptionId

Id

aCount

1

Set to 0

The number of active matters in the database.

2

Set to ApplicationId

The number of active matters for the application specified by its unique identifier ApplicationId.

3

Set to ClientId

The number of active matters for the client specified by their unique identifier ClientId

4

Set to 0

The number of test matters in the database.

5

Set to ApplicationId

The number of test matters for the application specified by its unique identifier ApplicationId.

6

Set to ClientId

The number of test matters for the client specified by their unique identifier ClientId.

2. GetMatters (OptionId, Id) returns MatterPackets

This method returns the MatterPackets for six cases, listed below, depending on the values for OptionId and Id. Use method Count(..), with the same input values, to ensure there is no error before using method GetMatters(..).

OptionId

Id

MatterPackets returned are

1

Set to 0

The active matters in the database.

2

Set to ApplicationId

The active matters for the application specified by its unique identifier ApplicationId.

3

Set to ClientId

The active matters for the client specified by their unique identifier ClientId

4

Set to 0

The test matters in the database.

5

Set to ApplicationId

The matters for the application specified by its unique identifier ApplicationId.

6

Set to ClientId

The matters for the client specified by their unique identifier ClientId.

3. GetFieldsCount(MatterId) returns aCount

This property returns the number of fields of the Matter whose unique identifier is MatterId.. This is the number of fields of the application used by the matter. If the value returned in aCount is negative then an error was detected and the corresponding error text is ErrorMsg(abs(aCount))

4. GetFields(MatterId) returns FieldPackets

This method returns the FieldPackets for the fields of the application used by the matter whose unique identifier is MatterID. A FieldPacket is a string containing three items: FieldId, TypeId, FieldName.

5. InsertMatterData(MatterId, FieldId, Data) returns Code

This method inserts or updates information in the matter database for the Matter identified by MatterId and the field identified by FieldId. If the FieldType of the field is TEXT or FILE then Data should contain one string. Paragraphs beyond the first paragraph will be ignored. If type is MEMO then Data can contain many paragraphs. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

6. GetMatterData(MatterId,FieldId,FieldTypeID, Code) returns Data

This method accepts a Matter's MatterId and the FieldId for a field in the Matter database and returns a StringList and an ErrorCode. If the FieldTypeID of the field requested is TEXT (1) or FILE (2) then Data will have at most one string. If the FieldTypeID is MEMO (3) the number of lines or paragraphs returned in Data can be obtained from GetMatterDataLineCount(MatterId,FieldId).

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)). A return of -3 in Code indicates the Data sought is missing.

If the requested data is missing and you have not called GetMissingClientData(0) then the data will be requested from a user. If the data is supplied it will be placed in the database and returned for this GetClientData call. If the data is not supplied then -3 will be returned in Code. If you called GetMissingClientData(0) as your last call to GetMissingClientData(..) then the missing data will not be requested and -3 will be returned in Code.

7. GetMissingMatterData(YN) has no return value

GetMissingMatterData(1) is the default. Making this call has this effect. When a call is made to GetMatterData(...) and the requested data is missing, which is the case when the requested data has never been entered to the database, then the user will be asked to supply the data. If the data is supplied it is placed in the database and returned for the GetMatterData(...) call. If it is not supplied the value of Code in the GetMatterData(...) call is returned as -3.

GetMissingMatterData(0) or GetMissingMatterData(N) where N is not 1 has this effect. Missing data is not requested in calls to GetMatterData(...) and -3 is returned in the Code value when the requested data is missing.

8. GetMatterDataLineCount(MatterId, FieldId) returns Count

This method accepts the MatterId and FieldId and returns the number of paragraphs of data for this matter and field. If the field is of type TEXT or FILE then Count is 1. Only if the field type is MEMO will the Count be 1 or more.

9. InsertMatter(ClientID, ApplicationID, MoreToCome) returns MatterID INCOMPLETE Not yet operational

10. GetMatterDescription(MatterId, Code) returns Description

This method returns the description of the matter whose unique identifier is MatterId. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

11 InsertMatterDescription(MatterId,MatterDescription) returns Code

This method inserts a description for the matter whose unique identifier is MatterId. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

12. GetMatterNotes(MatterId, Code) returns Notes.

This method returns the matter notes for the matter whose unique identifier is MatterId. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

13. InsertMatterNotes(MatterId,Notes) returns Code

This method inserts notes for the matter whose unique identifier is MatterId. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

14. OpenMatter(MatterId) returns Code

This method opens in bcdDouments the matter whose unique identifier is MatterId. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)). If the matter is already open it stays open, and is made the active window.

15. OpenMatterByName(MatterName, Code) returns MatterID

This method opens in bcdDouments the matter whose case insensitive name is MatterName. The MatterID of this matter is returned. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)). If the matter is already open it stays open, and its window is made the active window.

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

NWDSets interface

The Non-Working Day Set interface has two properties.

The Properties are:

Property Name

Parameters

Return Type Value

 

Input

Output

 

Count

None

None

Integer. The number of NWDSets.

NWDSets

None

None

StringList: Each string is a NWDSetPacket. There will be Count strings in the StringList.

If a negative number is returned for Count an error was detected. A text message indicating the error can be retrieved using the property ErrorMsg(abs(Count)) supplied by theProgram interface.

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

PickLists interface

The PickLists interface allows program to get and set data from and to the Pick Lists. All access is through methods.

The Methods are:

1. CountListItems ( ListId ) returns Count

Count is the number of items in the list whose identifying Id is ListId. If the value returned in Count is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Count).

2. CountListsOfType ( TypeID ) returns Count

This method accepts a pick list TypeId, the integer identifying a type of pick list, and returns in Count the number of list of this type. If the value returned in Count is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Count)).

3. CountTypes returns Count

If the value returned in Count is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Count)).

4. GetList (ListId, Code) returns Data

This method accepts a list's ListId and returns and ErrorCode Code and a StringList Data. Each string in Data is a ListItemPacket. e.g. The StringList therefore consists of the items in the list.

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)).

5. GetListDescription (ListId, Code) returns Data

This method accepts a list's ListId and returns and ErrorCode Code and a StringList Data. The returned Data is a single string containing the Description of the list.

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)).

6. GetListName (ListId, Code) returns Data

This method accepts a list's ListId and returns and ErrorCode Code and a StringList Data. The returned Data is a single string containing the name of the list.

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)).

7. GetListsOfType (ListId, Code) returns Data

This method accepts a list type Id TypeId and returns and ErrorCode Code and a StringList Data. Each string in Data is a ListPacket. e.g. "Partners,List of partners of our firm,321". At present there are four list types.

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)).

8. GetTypes returns Data

This method returns a stringList Data. Each string in Dats is a ListTypePacket. e.g. "1,TXT". At present there are four list types.

TypeId

List Type

Meaning

1

TXT

a list of text items

2

DOC

a list of documents or files

3

CLT

a list of clients

4

MMO

a list of memos

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

Sites interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

Sites interface

The Sites interface allows you to get and set Site data. There are four properties and three methods.

The Properties are:

Property Name

Parameters

Return Type Value

 

Input

Output

 

Sites

None

None

StringList: Each string is a SitePacket.

Count

None

None

Integer. The number of fields in the site database.

Fields

None

None

StringList: Each string is a FieldPacket.

FieldsCount

None

None

Integer: The number of Fields in the site database

If a negative number is returned for those Property values which are integers, an error was detected. A text message indicating the error can be retrieved using the property ErrorMsg(abs(ErrorCode)) supplied by theProgram interface, where ErrorCode is the returned negative number.

The Methods are:

1. GetSiteData (SiteId,FieldId,FieldTypeID, Code) returns Data

This method accepts a site's SiteId and the FieldId for a field in the Site database and returns a StringList and an ErrorCode. If the FieldTypeID of the field requested is TEXT (1) or FILE (2) then Data will have at most one string. If the FieldType is MEMO (3) the number of lines or paragraphs returned in Data can be obtained from GetSiteDataLineCount(ClientId,FieldId). The FieldID can be obtained from method GetFieldIdFormName() if you know the name of the field you want. The field names in the site database are listed using the Fields property.

If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)). A return of -3 in Code indicates the Data sought is missing.

If the requested data is missing and you have not called GetMissingSiteData(0) then the data will be requested from a user. If the data is supplied it will be placed in the database and returned for this GetSiteData call. If the data is not supplied then -3 will be returned in Code. If you called GetMissingSiteData(0) as your last call to GetMissingSiteData(..) then the missing data will not be requested and -3 will be returned in Code.

2. GetMissingSiteData(YN) has no return value

GetMissingSiteData(1) is the default. Making this call has this effect. When a call is made to GetSiteData(...) and the requested data is missing, which is the case when the requested data has never been entered to the database, then the user will be asked to supply the data. If the data is supplied it is placed in the database and returned for the GetSiteData(...) call. If it is not supplied the value of Code in the GetSiteData(...) call is returned as -3.

GetMissingSiteData(0) or GetMissingSiteData(N) where N is not 1 has this effect. Missing data is not requested in calls to GetSiteData(...) and -3 is returned in the Code value when the requested data is missing.

3. GetSiteDataLineCount (SiteId, FieldId) returns Count

This method accepts a Site's SiteId and the FieldId for a field in the client database and returns an integer Count, being the number of paragraphs in the Site data for this site and field. If the FieldType of the field requested is TEXT or FILE then Data will have at most one string. If the FieldType is MEMO the number of lines or paragraphs may be more than one.

If the value returned in Count is 0 then no data was found in the field.

If the value returned in Count is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Count))

4. InsertSiteData (SiteId,FieldId,Data) returns Code

This method inserts or updates information in the site database for the client identified by SiteId and the field identified by FieldId. If the FieldType of the field is TEXT or FILE then Data should contain one string. Paragraphs beyond the first paragraph will be ignored. If the Type is MEMO then Data can contain many paragraphs. If Code is negative then an error was detected and the corresponding error message is ErrorMsg(abs(Code)).

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Statuses interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

Statuses interface

In bcdDocuments statuses apply to Clients, Applications and Matters. There are two Properties in this interface.

Property name

Parameters

Return Type:Value

 

Input

Output

 

Count

None

None

Integer:The number of Statuses used in the database.

Statuses

None

None

StringList: The format of each string returned is StatusTypeId, Status.

At present the the Count property is 5 and the Statuses property is:

"1,TEST", "2,ACTIVE", "3,ARCHIVED", "4,CLOSED", "5,MISSING".

Other statuses may be added in the future.

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

TheProgram interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

TheProgram interface

The TheProgram interface provides three properties:

Property Name

Parameters

Return Type:Value

 

Input

Output

 

Show

Integer
1=Show the bcdDocuments program.
0=Minimize it

None

None

Version

None

None

StringList: The version string of the bcdDocuments Program. e.g. 4.0.1.199 (Release.MajorSubrelease. MinorSubrelease.BuildNumber)

ErrorMsg

Integer N

None

String:The text of an error message for the integer N, which must be positive. (see the examples in the Client interface section)

The Version method returns one string.

In This Section

TheProgram interface VB example

TheProgram interface Delphi example

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

Users interface

Previous Topic

Next Topic

Book Contents

Book Index

TheProgram interface VB example

The following VBA code sample is taken from an MS Word VBA macro. A working macro is in the MS Word template bcdDocsSample.dot found in the <Program Folder>\Automation\VBA Example

Set bcdProgram = New BcdDocuments.TheProgram

Private Sub BtnVersion_Click()

'TBVersion is a TextBox

TBVersion.Text = bcdProgram.Version(0)

End Sub

Private Sub CBShow_Click()

'CBShow is a CheckBox

If CBShow.Value = True Then bcdProgram.Show = 1 _

Else: bcdProgram.Show = 0

End Sub

See Also

TheProgram interface

TheProgram interface Delphi example

Previous Topic

Next Topic

Book Contents

Book Index

TheProgram interface Delphi example

The following Delphi code was taken from a Delphi 6 working program. A Delphi 6 project is in the Program Folder under ...\Automation\Delphi Project\

// somewhere in initialization code
// bcdProram : IthePogram
// bcdProgram := coTheProgram.Create
// and for shutdown code use
// bcdProgram := nil

procedure TfrmComTest.BtnSetShowClick(Sender: TObject);

var

I : integer;

begin

if not assigned (bcdProgram) then Exit;

try

I:= strtoInt(EditShow.text);

if (I<>0) and (I<>1) then

begin

I:=0;

EditShow.Text := '0'; // EditShow is a TEdit control

MessageDlg('Show was set to 0.', mtInformation, [mbOK], 0);

end;

bcdProgram.Show := I;

except

begin

MessageDlg('Show must be 0 or 1.', mtError, [mbOK], 0);

EditShow.SelectAll;

EditShow.SetFocus;

end;

end;{try}

end;

procedure TfrmComTest.BtnGetVersionClick(Sender: TObject);

begin

if not assigned (bcdProgram) then Exit;

EditVersion.Text := bcdProgram.Version[0]; // EditVersion is a TEdit control

end;

See Also

TheProgram interface

TheProgram interface VB example

Previous Topic

Next Topic

Book Contents

Book Index

Users interface

The Users interface provides methods for information about staff or users placed in bcdDocuments using the Staff Assistant.

A UserPacket is a string containing two things: a UserId and the name of the User with this Id. e.g. "32,jwallace". The UserId is the number of the staff member or user as registered in bcdDOcuments. The user name is also as registered with bcdDocuments and must be the user's Windows logon name.

The Methods are:

1. GetUsers returns Data

This method returns a StringList where each string is a UserPacket. he number of strings returned is GetUsersCount.

2. GetUsersCount returns Count

This method returns the number of user's registered with bcdDocuments.

3. GetUsersLike (LikeName) returns Data.

This method looks for users whose name is like the input string. The input string can use wild card characters % (for any set of characters) or _ (for a single character). The returned string list consists of UserPackets. If there are no wild card characters in LikeName then the ClientPacket for the specified single client is returned or GetUsersLikeCount (LikeName) is 0. The search is case sensitive.

4. GetUsersLikeCount (LikeName) returns Count

This method looks for users whose name is like the input string. The input string can use wild card characters % (for any set of characters) or _ (for a single character). The returned Count is the number of users whose name is like LikeName. The search is case sensitive.

Example: Names like "_Bloggs" are "FBloggs", fBloggs" and "JBloggs". Names not like "_Bloggs" are "hbloggs", "MSTEIN" and "hBLOGGS".

Example: Names like "%ggs" and "FBloggs" and FSaggs" but not "FBLOGGS".

5. GetUserLastName(UserID) returns LastName

This method takes a user's UserID and returns their last name.

6. GetUserFirstName(UserID) returns FirstName

This method takes a user's UserID and returns their first name.

7. GetUserDDI(UserID, Code) returns DDI

This method takes a user's UserID and returns their DDI as recorded using the Staff Assistant. If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)).

8. GetUserEmail(UserID, Code) returns DDI

This method takes a user's UserID and returns their DDI as recorded using the Staff Assistant. If the value returned in Code is negative then an error was detected and the corresponding error text is ErrorMsg(abs(Code)).

See Also

Interfaces

Applications interface

Clients interface

DocumentData interface

FieldTypes

MatterAssignmentSets interface

MatterDataSets interface

MatterEvents Interface

Matters interface

NWDSets interface

PickLists interface

Sites interface

Statuses interface

TheProgram interface