GoldMine API Integration Guide
GoldMine API Integration Guide
WARNING: The software described in this manual and its related user documentation are protected by copyright law.
In no event, shall any part of the related user documentation be copied, reproduced, distributed, transmitted, stored
in a retrieval system, or translated into any language, without the express written permission of FrontRange Solutions
USA Inc.
)URQW5DQJH7UDGHPDUN,QIRUPDWLRQ
The following are trademarks of FrontRange Solutions USA Inc. and/or its affiliates in the United States and/or other
countries: FrontRange Solutions®, FrontRange™, GoldMine®, GoldSync®, GoldMine® Answer Wizard™, Gold-
Mine® Management Intelligence™, GoldMine® Manager’s Console™, iGoldMine™, HEAT®, HEAT® Service &
Support™, HEAT® PowerDesk™, iHEAT™, HEAT® Self Service™, HEAT® Manager’s Console™, HEAT®
Answer Wizard™, HEAT® Quick Start Wizard™, InfoCenter®, Automated Processes™, First Level Support®,
enteo®, DeviceWall®, Centennial Discovery®, Discovery Dashboard®, MicroAudit®, SAM™ and other FrontRange
products and brands.
DataStream _________________________________________________________
437H 421
87H
DataStream _________________________________________________________
43H 428
893H
Print Conventions
Print conventions used throughout this manual provide a consistent way of
representing screen displays, command entries, and keyboard characters viewed
while working with GoldMine.
Screen Menu items, dialog boxes, and field names are printed in a bold typeface
Items similar to the typeface displayed in GoldMine onscreen displays. For
example, the option to toggle the status bar display appears in print as Status
Bar. In general, any text that appears on the screen is printed to look like the
screen display.
Command Commands or other keystroke strings entered by the user are printed in a
Entries monospaced typeface that shows exact spacing between terms.
General Conventions
General conventions used throughout this manual provide a consistent way of
referencing individual or multi-step actions.
Select refers to executing commands that are available as menu options or making a
choice among available items from a browse window or a drop-down list.
Steps that involve two or more selections from a menu may be presented as a
combination selection; that is, the menu options are presented in sequence, divided
by |. For example, when you read
“To schedule an appointment, select Schedule|Appointment”
select Schedule on the Main Menu to display a drop-down list, from which you can
select Appointment.
Performing
an action described in
a procedure
Mouse Conventions
If you use a multiple-button mouse with GoldMine, the left mouse button is
configured as the primary mouse button. The right mouse button serves as the
secondary button.
The following terms describe mouse actions referenced throughout this manual.
Point Position the mouse pointer until the tip of the pointer rests on the desired area of
input on the screen, such as an option on a pull-down menu.
Click Press and immediately release the left mouse button without moving the mouse.
For example, click OK indicates that you must click the OK button with the mouse.
Right-click Press and immediately release the right mouse button without moving the mouse.
Drag Click and hold the left mouse button while moving the mouse pointer.
Introduction to
Integrating with GoldMine
Integrating with GoldMine is designed as a comprehensive resource for developers
to integrate GoldMine with their applications. For best results, we recommend that
you become an experienced GoldMine user before taking on an integration project.
For example, understanding what types of data are better stored as a detail record
instead of a history record will ensure greater success for your project.
In addition to gaining experience with GoldMine, you should be familiar with the
development environment you plan to use. This manual may not provide
programming examples for your preferred development environment. With a good
working knowledge of your chosen programming language, you could learn from
another language’s examples.
This manual provides information to:
• Use one of several methods to integrate with GoldMine.
• Work with either Xbase or SQL database structures to integrate with
GoldMine up to version 6.7.
• Work with either Firebird or MSSQL database structures to integrate with
GoldMine version 7.0.
• Access a variety of support resources to get help from other developers
and GoldMine technicians.
21
Integrating With GoldMine
22
Integrating With GoldMine
23
Integrating With GoldMine
24
Integrating With GoldMine
Integration Tools
The following tools can help greatly when integrating with GoldMine:
DDEREQUESTOR:
A Windows-based freeware that allows you to send DDE commands to GoldMine in
real-time. This utility can help to diagnose problems you may have when using DDE
to integrate with GoldMine.
XMLSPY:
A development environment for modeling, editing, debugging, and transforming all
XML technologies, then automatically generating runtime code in multiple
programming languages.
Technical support for these programs is not available from FrontRange Solutions.
25
Working with Dynamic
Data Exchange (DDE)
Dynamic Data Exchange (DDE) is the term for the Windows functionality that allows
GoldMine to exchange commands and information with other applications. Using
DDE, one application, referred to as the client application, can request information
from or send commands to another application—referred to as the server application.
The server application then processes the request from the client application. In
response to a client’s request, the server performs a task such as updating or
returning data housed by the server application
GoldMine is designed to act as both a DDE client as well as a DDE server. DDE
topics included in this chapter describe using GoldMine as a DDE server. These
topics are provided for programmers who wish to interface their programs with
GoldMine. If you are not familiar with working with DDE, this technical section may
be of limited value to you.
27
Integrating With GoldMine
29
Integrating With GoldMine
can return large blocks of data very quickly. Retrieving data from large databases
may take longer, causing your DDE request to time-out.
For details on installing the GoldMine DDE link to Word for Windows, see related
material at support.frontrange.com.
30
Integrating With GoldMine
With txtGMDDE
.LinkMode = vbLinkNone
31
Integrating With GoldMine
.LinkTopic = "GoldMine|Data"
.LinkMode = vbLinkManual
End With
DDEInitiate = 1
Exit Function
Err_DDE:
If Err = 282 Then
DDEInitiate = 282
Else
Err.Description = "DDE Error:" & Err & " :" & Err.Description
DDEInitiate = 0
End If
End Function
To request data:
Public Function DDERequest(sExpr As String) As String
With txtGMDDE
.LinkItem = sExpr
.LinkRequest
DDERequest = .Text
End With
End Function
With these functions declared in your project, you may then call them where needed
in your code.
32
Integrating With GoldMine
Depending on the type of application involved, you would typically select one of
these three access methods; however, you can mix all three access methods within
the same application. The function categories are described on the following pages.
The Append function is used to add an empty record to a GoldMine data file. Before
using Append, you must open a data file using the Open function. After executing
the Append function, the record pointer is positioned at the new empty record, and
the record is locked and ready to accept field replacements.
When a CONTACT1 record is appended, GoldMine automatically propagates the
new record with the appropriate ACCOUNTNO and CREATEBY values. For all
other records, you must replace the ACCOUNTNO field with the value from the
CONTACT1 record with which the new record is to be linked. For records that
require remote synchronization initialization, GoldMine will automatically
propagate the value of the RECID field when these records are appended.
Parameters
The Append function accepts one parameter, the work area handle of the file to
Append. The work area handle is returned by the Open file when the file is opened.
Return Value
Xbase: The Append function returns the record number of the new record, or 0 if the
file could not be locked.
SQL: The Append function returns the record ID.
EXAMPLE
The following example demonstrates how to add a contact record in GoldMine via
DDE.
33
Integrating With GoldMine
Sub Main()
Dim sQ
Dim sWorkArea As String
Dim lChannel As Long
Dim sRet As String
sQ = Chr(34)
'Open a DDE channel
lChannel = DDEInitiate("GoldMine", "Data")
sWorkArea = DDERequest(lChannel, "[Open(Contact1)]")
If sWorkArea <> "0" Then 'Database was opened
'Append a new record to Contact1
sRet = DDERequest(lChannel, "[Append(" + sWorkArea + ")]")
If sRet <> "0" Then 'Record was Appended
StatusBar = "New Record Added"
'Replace Company name with "New Record"
sRet = DDERequest(lChannel, "[Replace(" + sWorkArea + "," + sQ(34)
+ "Company" + sQ(34) + "," + sQ + "NewRecord" + sQ + ")]")
If sRet = "1" Then
StatusBar = "Replaced complete"
Else
StatusBar = "Replaced Failed"
End If
'Unlock and Close the record
sRet = DDERequest(lChannel, "[Unlock(" + sWorkArea + ")]")
sRet = DDERequest(lChannel, "[Close(" + sWorkArea + ")]")
Else
StatusBar = "Error Opening Contact1"
End If
End If
'Terminate the DDE Channel
DDETerminate (lChannel)
End Sub
The Close function is used to release a previously OPENed file when processing is
complete. When access is complete, a file must be CLOSEd to release memory used
by GoldMine to maintain database work areas.
PARAMETERS
The Close function accepts one parameter—the work area handle of the file to close.
The Open file returns the work area handle when the file is opened.
34
Integrating With GoldMine
RETURN VALUE
The Close value returns 1 if the function was able to successfully close the work area,
0 if an invalid work area handle was passed.
EXAMPLE
See “Adding an Empty Record” on page 33.
The Delete function deletes the current record in the specified work area. The record
pointer is not advanced to the next record.
PARAMETERS
The Delete function takes one parameter—the work area value obtained from the
Open function.
EXAMPLE
DDERequest(lChannel, "[Delete(" + sWorkArea + ")]")
The Filter function limits access to data in a GoldMine database by creating a subset
of records based on expression criteria.
PARAMETERS
The Filter function takes two parameters. Enclose each parameter in quotation marks
(“).
The first parameter is the work area handle of the file that you want to read. The
Open function provides this value when the data file is opened.
The second parameter is a valid Xbase expression.
To remove the filter from the database, use a Filter function with an empty string,
such as [FILTER(<work area>,"")].
EXAMPLE
This example will scan the current contact’s history for all activities completed by a
specific user. It works by first setting the Range of history to a specific contact via the
AccountNo. Once the range is set, the Filter is applied to “see” only records for a
specific user within that range.
Sub Main()
Dim lChannel As Long
Dim sRet As String
Dim sWorkArea As String
35
Integrating With GoldMine
Dim sQ As String
Dim sAccNo As String
Dim sUser As String
Dim bEOF As Boolean
Dim Counter As Integer
36
Integrating With GoldMine
'Display results
MsgBox (Str$(Counter) + " history records for this contact have a
User = '" + sUser + "'")
End If
'Close DDE channel
DDETerminate (lChannel)
End Sub
The IsSQL function returns the table type (Xbase or SQL) that is open in a work area.
Using this DDE command, you can determine the most appropriate method to
retrieve information when working with DataStream—see “Returning GoldMine
Record Data” on page 55. For example, when your routine starts, you can open
Contact1 and Cal, issue an IsSQL command to determine the GoldDir and
CommonDir database types, and then close both work areas. You can then send the
appropriate DataStream calls.
PARAMETERS
The IsSQL function takes work area as the only parameter.
RETURN VALUES
IsSQL returns 1 for an SQL database table, or 0 for an Xbase file.
The Move function will position the record pointer to a particular record in a data
file. Before using Move, you must open a data file using the Open function.
PARAMETERS
The Move function requires either two or three parameters.
The first parameter is the work area handle of the file whose record pointer you
want to position. The Open function provides this value when the data file is
opened.
The second parameter is the name of the Move subfunction that you want to
perform.
Depending on the subfunction, a third parameter can be required.
The following table lists the Move subfunctions and the requirements for the third
parameter:
Valid Move Subfunctions
Subfunction Description 3rd Parameter
TOP Move to first logical record Not required
37
Integrating With GoldMine
Top Positions the record pointer at the first logical record according to the current index
order. For example, if the data file open in the selected work area is CONTACT1.DBF,
and the index order is set to Company, a call to TOP will result in the record pointer
being positioned at a record with a company name, such as AAA Cleaners.
Bottom Positions the record pointer at the last logical record according to the current index
order. For example, if the data file open in the selected work area is CONTACT1.DBF,
and the index order is set to Company, a call to BOTTOM will result in the record
pointer being positioned at a record with a company name, such as Z-best Bakery.
Skip Moves the record pointer record by record. If SKIP is called without the third
parameter, it will move the record pointer to the next logical record according to the
current index order. If SKIP is called with a string numeric as the third parameter, the
record pointer will be moved forward by the indicated number if the value is positive, or
backward if the value is negative. Negative numbers must be passed in quotation
marks, for example “-1”.
Goto Positions the record pointer at the record number (Xbase) or record ID (SQL) specified
by a string numeric passed as the third parameter.
Seek Attempts to locate a record in the data file with an index key that matches the string
passed as the third parameter. Partial key searches are allowed; GoldMine will
position the record pointer at the record with the key that most closely matches the
passed value.
Setorder Selects an active index for ordering and SEEKing the data file. See “Database
Structures” on page 377 for the appropriate values and collating sequence for each
data file index.
If an invalid index is selected for the data file, none of the MOVE subfunctions will
operate properly.
RETURN VALUE
The Move function can return several values.
Move Return Values
Return Description
0 Error occurred
1 Record pointer successfully moved, or index selected
2 Exact match not found, pointer positioned at closest match
38
Integrating With GoldMine
Return Description
3 Record pointer positioned at end-of-file (EOF)
4 Record pointer positioned at beginning-of-file (BOF)
An error can be returned under any of the following conditions:
• Invalid work area handle is passed to the function.
• Invalid subfunction is passed.
• Out-of-range record number is passed.
• Nonnumeric value is passed as a third parameter when a numeric value
is expected.
EXAMPLE
The following example will open Contact1, perform various Move operations, and
display the resulting contact name between Moves.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sWorkArea As String
Dim sRet As String
Dim iX As Integer
Dim sSeekVal As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sWorkArea = DDERequest(lChannel, "[Open(Contact1)]")
39
Integrating With GoldMine
'Goto Record 10
sRet = DDERequest(lChannel, "[Move(" + sWorkArea + ", Goto, 10)]")
MsgBox ("Goto: Contact=" + DDERequest(lChannel, "[Read(" + sWorkArea
+ ", Contact)]"))
The Open function is used to open a GoldMine data file for processing by another
application. This function must be called before calling any GoldMine DDE
functions that work with an individual data file. It is not necessary to use this
function when calling the RecordObj function, because this function opens the
necessary data files automatically.
PARAMETERS
The Open function takes one parameter—the name of the file to open. The following
values are valid for this parameter:
Open Valid Parameters
File Description
CAL Calendar activities file
40
Integrating With GoldMine
File Description
CONTACT1 Primary contact information file
CONTACT2 Primary contact information file
CONTGRPS Groups file
CONTHIST History records file
CONTSUPP Supplementary records file
INFOMINE InfoCenter file
LOOKUP Lookup file
MAILBOX E-mail Center mailbox file
OPMGR Opportunity Manager file
PERPHONE Personal Rolodex file
RESOURCE Resources file
SPFILES Contact files directory
RETURN VALUE
The Open function returns an integer value representing the handle to the file’s work
area. This value is required for all subsequent access to the file. If the file could not
be opened, or an invalid parameter is passed, the function will
return 0.
EXAMPLE
See “Adding an Empty Record” on page 33.
The Range function activates the index in a table and sets a range of values to limit
the scope of data that GoldMine will search.
PARAMETERS
The Range function requires four parameters.
The first parameter is the work area handle of the file that you want to read. The
Open function provides this value when the data file is opened.
The second parameter is the minimum value of the range. Enclose this parameter in
quotation marks (“).
The third value is the maximum value of the range. Enclose this parameter in
quotation marks (“).
The fourth value is the tag that corresponds to the index file. For details about tags,
see “Database Structures” on page 377.
41
Integrating With GoldMine
EXAMPLE
See “Creating a Subset of Records” on page 35.
The Read function is used to query a data file for the value of a field. Before using
Read, you must open a data file using the Open function. In addition, you will
probably want to position the record pointer to the record you want to query by
using the Move function.
PARAMETERS
The Read function requires two parameters.
The first parameter is the work area handle of the file that you want to read. The
Open function provides this value when the data file is opened.
The second parameter is the name of the field in the data file whose value you want
to query. You will normally pass only a single field name, such as CONTACT as the
second parameter. However, if you pass a field expression, such as “COMPANY +
CONTACT” GoldMine will attempt to evaluate the expression and return the value of
the expression. When an expression is passed as the second parameter, the
expression must be surrounded by quotation marks.
RETURN VALUE
The Read function returns a character string containing the value in the specified
field, or the value of the specified expression. If an error occurs, the Read function
returns a null string. The error could be caused by an invalid work area handle, an
invalid field being passed, or an expression that GoldMine could not evaluate.
EXAMPLE
See “Moving to a Specified Record” on page 37.
PARAMETERS
The RecNo function accepts one parameter—the work area handle of the file. The
work area handle is returned by the Open file when the file is opened.
RETURN VALUE
The RecNo function returns the current record number position, 0 if an invalid work
area handle was passed.
42
Integrating With GoldMine
EXAMPLE
The following example will get the current Contact1 RecNo and display it in the
GoldMine status bar.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sWorkArea As String
Dim sRet As String
Dim sRecNo As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "data")
sWorkArea = DDERequest(lChannel, "[Open(Contact1)]")
sRecNo = DDERequest(lChannel, "[RecNo(" + sWorkArea + ")]")
sRet = DDERequest(lChannel, "[Close(" + sWorkArea + ")]")
sRet = DDERequest(lChannel, "[StatusMsg(" + sQ + "RecNo=" + sRecNo +
sQ + ")]")
MsgBox ("GoldMine's status bar should now display the RecNo ")
End Sub
The Replace function is used to change the value in a particular field in one
GoldMine data file. Before using Replace, you must open a data file using the Open
function. In addition, you will probably want to position the record pointer to the
record you want to change either by using the Move function, or by adding a new
record with the Append function.
After executing the Replace function, GoldMine will update the specified field with
the new value, and update the appropriate remote synchronization data structures
to indicate that the field was changed.
In a network environment, GoldMine automatically locks the record before
performing the replacement. The record is not automatically unlocked, allowing for
fast multiple field replacements. The record is automatically unlocked when a Close,
Move, or Unlock command is issued on the work area.
PARAMETERS
The Replace function requires three parameters and has an optional fourth
parameter.
43
Integrating With GoldMine
The first parameter is the work area handle of the file in which you want to perform
the replacement. The Open function provides this value when the data file is opened.
The second parameter is the name of the field to be replaced. See “Database
Structures” on page 377 for information on the name of fields in each GoldMine data
files. If you attempt to replace a field that does not exist in the file open in the
specified work area, the Replace function will fail.
The third parameter is the value to replace. This value must be enclosed in quotation
marks. The replace value must be a string value. If the replacement field is a date or
numeric field, GoldMine will convert the string data to the appropriate data type
prior to performing the replacement.
The fourth parameter will add data instead of replacing data. Using this parameter,
you can insert large amount of text into a notes field. To append instead of replace
incoming data from the third parameter, pass 1 as the fourth parameter. You can set
up a loop to feed notes in 256-byte segments to override the 256-byte limit for
inbound DDE requests.
RETURN VALUE
If the file was replaced, the Replace function returns 1. If the field could not be
replaced, 0 is returned. The failure can be caused under any of the following
conditions:
• Invalid parameter, such as an invalid work area handle.
• Invalid field name.
• Record already locked by another user.
EXAMPLE
See “Adding an Empty Record” on page 33.
The Search function is used to perform a sequential search on a file. Unlike Move,
Search scans the table, one record at a time, looking for a record that satisfies the
search condition. The search condition can be any Xbase expression that GoldMine
understands, but is usually an expression that tests the value of one or more fields in
the file. When a match is found, the record pointer is located at the matching record.
Search starts with the record that immediately follows the current record (the next
logical record according to the selected index order) and continues until a match is
found or the end of file is encountered. Because of this, Search can be called
repeatedly to return a list of records that satisfy the search condition.
PARAMETERS
The Search function takes three parameters.
44
Integrating With GoldMine
The first parameter is the work area handle of the file you want to search. The Open
function provides this value when the data file is opened.
The second parameter is the search expression, such as "CITY='Los Angeles'"
The expression must be surrounded by quotation marks, and any string literal
characters with the expression must be surrounded by single quotes (').
The third parameter is the optional index order to use when searching the data file.
When this parameter is not specified, the data file is searched by record number
(physical) order. See “Database Structures” on page 377 for the appropriate values
and collating sequence for each data file’s indexes.
If an invalid index is selected for the data file, the Search function will not operate
properly.
RETURN VALUE
The Search function can return several values.
Search Return Values
Return Description
0 Error occurred or match could not be found
>1 Match found; return value indicated current physical record number (Xbase)
or record ID (SQL)
An error can be returned if an invalid work area handle is passed to the function, or
if an invalid search condition is passed.
EXAMPLE
The following example will prompt the user for a city name, then display the contact
name for the first matching record.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sWorkArea As String
Dim sRet As String
Dim sSeekVal As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sWorkArea = DDERequest(lChannel, "[Open(Contact1)]")
45
Integrating With GoldMine
Unlocking a Record
Syntax [UNLO CK(<work area>)]
The Unlock function unlocks a record previously locked by a call to either Append
or Replace. GoldMine does not specifically release a lock on a record until you call
Unlock, allowing you to perform multiple field replacements quickly. Before using
Unlock, you must open a data file using the Open function.
After calling Unlock, GoldMine will also update the remote synchronization data
structures to indicate the date and time that the record was modified.
PARAMETERS
The Unlock function accepts one parameter—the work area handle of the file to
close. The work area handle is returned by the Open file when the file is opened.
RETURN VALUE
The Unlock function returns 1 if the record was unlocked, or 0 if an invalid work
area handle was passed to the function.
EXAMPLE
See “Adding an Empty Record” on page 33.
46
Integrating With GoldMine
PARAMETERS
The RecordObj function requires either one or two parameters.
The first parameter is the name of the RecordObj subfunction that you want to
perform.
Depending on the subfunction, a second parameter can be required. The following
table lists the RecordObj subfunctions and the requirements of the second parameter.
Valid RecordObj Functions
Subfunction Description 2nd Parameter
SETOBJECT Create or select contact record Optional object pointer
TOP Move to first logical record Not required
47
Integrating With GoldMine
Setobject The SetObject call must be called prior to calling any other RecordObj subfunction
to specify the contact record that subsequent RecordObj calls will manipulate.
If SetObject is called without a second parameter, subsequent calls to RecordObj
will manipulate the currently active contact record. The user can change the active
contact record in GoldMine while the DDE conversation is active, but this will not
affect the contact record that is linked to the RecordObj function.
If SetObject is called with a second parameter of 0, GoldMine will create a
minimized contact record in the work area display, and subsequent calls to
RecordObj will manipulate that contact record. If SetObject is called with a second
parameter of 1, GoldMine will create a minimized contact record in the work area
display and copy any filter or group active on the last used contact record into the
newly minimized contact record.
If RecordObj is called with a specific pointer number, GoldMine will attempt to
establish a link with that contact record. A client application can obtain this pointer
only when using the GoldMine document merging feature, when GoldMine, acting
as a DDE client, passes this long pointer as the seventh parameter.
Top Positions the record pointer at the first logical record according to the current index
order. For example, if the contact record index order is set to Company, a call to
Top will result in the record pointer being positioned at a record with a company
name such as “AAA Cleaners.” GoldMine will also update the contact record to
display the new record.
Bottom Positions the record pointer at the last logical record according to the current index
order. For example, if the contact record index order is set to Company, a call to
Bottom will result in the record pointer being positioned at a record with a
company name such as “Z-best Bakery.” GoldMine will also display the new
record.
48
Integrating With GoldMine
Skip The Skip subfunction moves the record pointer on a record-by-record basis.
If Skip is called without the second parameter, it will move the record pointer to the
next logical record according to the current index order.
If Skip is called with a string numeric as the second parameter, the record pointer
will be moved forward by the indicated number of records if the value is positive,
or backwards if the value is negative. Negative numbers must be passed in
quotation marks, for example “-1.” GoldMine will also update the display to show
the new record.
The Skip subfunction is sensitive to any filter or group that can be active on the
contact record in GoldMine. For example, if the user applies a filter to the contact
record in GoldMine, the Skip subfunction will skip over any records that do not
match the filter expression.
Goto The Goto subfunction positions the record pointer at the record number specified
by a string numeric passed as the second parameter.
Seek Attempts to locate a record in the data file with an index key that matches the
string passed as the second parameter. Partial key searches are allowed, and
GoldMine will position the record pointer at the record with the key that most
closely matches the passed value. GoldMine will update the display to show the
new record.
Setorder Selects an active index for ordering and SEEKing the contact database. Only the
twelve CONTACT1 indexes can be used for this subfunction. See “Database
Structures” on page 377 for the appropriate values and collating sequence for
each data file’s indexes.
Getorder Returns the active index being used to sort the contact records. See “Database
Structures” on page 377 for the appropriate values and collating sequence for
each data file’s indexes.
Settitle Changes both the text in the title bar of the contact record’s window and the text
displayed below a minimized contact record. For example, a DDE application that
merges contact records within a document can modify the contact record title to
indicate the number of records that have been merged. Any text that is passed as
the second parameter must be enclosed in quotation marks, and will be used as
the new title’s text.
Closewindow Closes the contact record when processing is complete. Issuing this call is
equivalent to selecting Close from the contact record’s system menu.
Setrecord Changes the behavior of the Skip, Top, and Bottom subfunctions to allow ancillary
contact information (such as additional contacts) to be queried using the
RecordObj function. Normally, GoldMine assumes the CONTACT1 data file to be
the parent data file, and when the Skip, Top, or Bottom subfunction is called, the
record pointer is repositioned in this data file. When accessing information in
GoldMine tabs, however, the Skip, Top, and Bottom subfunctions must be able to
reposition the record pointer in the data file that stores these items (CONTSUPP).
The SetRecord subfunction accepts the name of the data structure being queried
as the second parameter. Valid data structure names are listed in the following
table.
49
Integrating With GoldMine
RETURN VALUE
All RecordObj subfunctions return 1 if the function was completed successfully or 0
if an internal error occurred.
EXAMPLE
The following example will count the number of additional contacts for the current
contact.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
50
Integrating With GoldMine
Sub Main()
Dim lChannel As Long
Dim sAccountNo As String
Dim sRet As String
Dim sANRT As String
Dim iAddCount As Integer
51
Integrating With GoldMine
EXAMPLE
This example retrieves various parameters from GoldMine and passes them to the
GMW_LoadAPI or GMW_LoadBDE function in the GMXS32.DLL.
The following example is written in Visual Basic 6.0 using the DDEInitiate and
DDERequest functions defined in Establishing a DDE Conversation on page 31.
With frmDDE
iResult = .DDEInitiate
If iResult Then
frmPaths.txtSysFolder = .DDERequest("&SysDir")
frmPaths.txtGoldDir = .DDERequest("&GoldDir")
frmPaths.txtCommonDir = .DDERequest("&CommonDir")
sLoginCredentials = .DDERequest("[GetLoginCredentials]")
lResult = GMW_LoadBDE(frmPaths.txtSysFolder,
frmPaths.txtGoldDir, _
frmPaths.txtCommonDir, “*DDE_LOGIN_CREDENTIALS*", _
sLoginCredentials)
End With
RETURN VALUE
The GetActiveOppty function returns the record ID of the currently selected
opportunity. If no opportunity is available, an empty string is returned.
EXAMPLE
The following example reads the currently selected Opportunity’s record ID and
displays the value in a message box.
The following example is written in Visual Basic 6.0 using the DDEInitiate and
DDERequest functions defined in Establishing a DDE Conversation on page 31.
With frmDDE
iResult = .DDEInitiate
If iResult Then
sResult = .DDERequest("[GetActiveOppty]")
MsgBox sResult
End If
End With
52
Integrating With GoldMine
PARAMETERS
The CalComplete function takes up to seven parameters. All parameters must be
passed in quotation marks.
The first parameter is the record number of the calendar activity to be completed.
The second parameter is the Activity Code. This parameter is optional.
The third parameter is the Result Code. This parameter is optional.
The fourth parameter is the User. If this parameter is not specified, the User field
defaults to the currently logged user.
The fifth parameter is the history Reference. This parameter is optional.
The sixth parameter is the Notes for the history record. This parameter is optional.
The seventh parameter indicates whether the function should retain its original date,
or use the current date/time. To retain the original date, set this value to 1.
RETURN VALUE
The CalComplete function returns the record number (Xbase) or record ID (SQL) of
the new history record created.
EXAMPLE
This example will open the CAL file, read the current RecNo (Xbase), or RecID
(SQL), and complete the record to History.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sRet As String
Dim sRecNo As String
Dim sHRecNo As String
Dim sWorkArea As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
53
Integrating With GoldMine
End Sub
The CallerID and CallerIDAll functions are used to inform the GoldMine user that
an incoming call has been identified by Automatic Number Identification (ANI)
equipment attached to the telephone system. By using the caller ID functions,
GoldMine can perform a lookup on the contact database, and attempt to locate a
contact record with a telephone number that matches the telephone number
extracted by the ANI device.
With the caller ID functions, GoldMine can automatically display the contact record
of the caller. A dialog box is displayed, allowing the user to select an action. A CallerID
function parameter is used to specify the message in the dialog box.
The two functions perform the same functionality with the difference of the
CallerIDAll command will search all phone numbers for the contact record (except
FAX), instead of just the Phone1 field.
PARAMETERS
The caller ID functions accept three parameters. The CallerIDAll function accepts a
fourth parameter that the CallerID function does not:
The first parameter is the telephone number of the caller as captured by the ANI
device. The calling application is responsible for formatting the telephone number
that appears in the Phone1 field in GoldMine. Enclose this parameter in quotation
marks (“).
The second parameter is the optional message to be displayed in the dialog box in
GoldMine. Enclose this parameter in quotation marks (“).
The third parameter specifies whether the dialog box is displayed. This parameter is
the sum of the required options. For example, to display the caller’s contact record in
the current window if the record is found, or to display the contact listing if the
caller’s phone number is not found, specify 6 (2+4) as the <display dialog>
parameter. The following table lists valid parameter values.
CallerID Parameters
Value Description
0 Dialog box is displayed (default when third parameter is not passed)
1 Dialog box is not displayed, and contact record is displayed in a new contact record
2 Dialog box is not displayed, and contact record is displayed in the current contact record
4 Contact Listing is displayed when GoldMine cannot find the contact’s telephone number.
To activate this option, add this value to the third parameter value.
8 Restores input focus to the window that had input focus just before CALLERID is
called—used by applications that control the entire interface.
54
Integrating With GoldMine
The fourth parameter that is only accepted by the CallerIDAll function is whether or
not to search the UPhone fields stored in Contact2. Set to 1 to search the UPhone
fields, or 0 to omit the UPhone fields.
RETURN VALUES
EXAMPLE
The following example demonstrates the CallerID function.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sRet As String
Dim sPhone As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sPhone = InputBox("Enter Phone to Look Up. Format:(###)###-####")
sRet = DDERequest(lChannel, "[CallerID(" + sQ + sPhone + sQ + ")]")
End Sub
Running a Counter
Syntax [C OUNTER(<string>,<inc>,<start>,<action>)]
The Counter function returns a sequence of consecutive numbers each time the
expression is evaluated.
PARAMETERS
The counter name must be unique, and can be a maximum of 10 characters. Each
evaluation of the Counter function increments the counter by the <inc> value.
The <start> and <action> parameters are optional. When <action> is 1, the start
value resets the counter. When <action> is 2, the counter is deleted. Counter stores
the count value between GoldMine sessions, and it is shared by all GoldMine users.
GoldMine can track an unlimited number of uniquely named counters. The counter
values are stored in the LOOKUP table.
RETURN VALUE
The Counter function returns a number incremented by <inc>.
55
Integrating With GoldMine
EXAMPLE
[Counter(“InvoiceNo”,1,1000)]
DataStream returns the data of ordered records from any GoldMine table using the
most efficient method possible. The caller can specify the fields and expressions to
return, as well as the range of records to return. A filter can optionally be applied to
the data set.
The DataStream method allows for many useful applications. One example would be
to publish the contents of GoldMine data on the Internet by merging HTML
templates with the data returned by DataStream. Web pages can be created to display
GoldMine data requested by a visitor. Based on the visitor’s selections, a company
could dynamically present a variety of HTML pages, such as:
• Addresses of product dealers in a particular city
• Financial numbers stored in Contact2
• Seating availability of upcoming conferences
With a fast Internet connection and a strong SQL server, the GoldMine client could
simultaneously respond to dozens of requests.
RECORD SELECTION
The DataStream command consists of four subcommands. Each subcommand takes
different parameters. The subcommands are shown below, in the order in which
they must be called:
[DataStream("range", sTable, sTag, sTopLimit, sBotLimit, sFields, sFilter, sFDlm,
sRDlm)]
[DataStream("query", sSQL, sFilter, sFDlm, sRDlm)]
[DataStream("fetch", nRecords, iHandle)]
[DataStream("close", iHandle)]
The “range” or “query” subcommands must be called first to request the data. The
“range” and “query” subcommands return an integer handle, iHandle, which must
be passed to the “fetch” and “close” subcommands. You must use either “range” or
“query”—not both.
[DataStream("range", sTable, sTag, sTopLimit, sBotLimit, sFields, sFilter, sFDlm,
sRDlm)]
PARAMETERS
The sTable, sTag, sTopLimit, and sBotLimit parameters determine the range of
records to scan, similar to the DDE SETRANGE command. The sFields parameter
specifies the requested fields and expression to return.
The sField parameter passed to the “range” subcommand should consist of the field
names and Xbase expressions to evaluate against each record in the data set. Each
56
Integrating With GoldMine
field must be terminated with the semicolon (;) character. Xbase expressions must be
prefixed with the ampersand (&) character and terminated with a semicolon.
The other “range” parameters are optional.
RETURN VALUE
The “range” subcommand returns a range of records based on an index.
[DataStream("query", sSQL, sFilter, sFDlm, sRDlm)]
The “query” subcommand sends the sSQL query for evaluation on the server.
PARAMETERS
The SQL query can join multiple tables and return any number of fields. The
optional sFilter parameter can specify a Boolean Xbase filter expression to apply to
the data set (even on SQL tables), similar to the DDE SETFILTER command. The
optional sFDlm and sRDlm parameters can override the return packet’s default field
and record delimiters of CR and LF.
[DataStream("fetch", nRecords, iHandle)]
The “fetch” subcommand returns a single packet string that contains the requested
data from all records processed by the current “fetch” command, as specified by the
second nRecords parameter. iHandle must be the value returned from “range” or
“query.” The “fetch” command can be issued multiple times, with positive and
negative values, to scroll down or up the cursor. See “Return Packet” below.
[DataStream("close", iHandle)]
The “close” subcommand must be called when the operation is complete. Unclosed
data streams will leak memory and leave the database connections needlessly open.
Passing an iHandle of 0 closes all open DataStream objects (of all DDE
conversations).
EXAMPLE 1
The following commands request the first 100 cities from the Lookup file, including
the city name and record number (RecID under SQL):
[DataStream("range", "lookup", "lookup", "CITY", "CITYZ", "Entry;
&RecNo();")]
[DataStream("fetch", 100, iHandle)]
[DataStream("close", iHandle)]
EXAMPLE 2
The following commands request the first 10 profiles of the current contact record,
followed by a request for the next 50:
[DataStream("range","contsupp","contspfd", sAccNo+"P", sAccNo+"P",
"Contact;ContSupRef;")]
[DataStream("fetch", 10, iHandle)]
[DataStream("fetch", 50, iHandle)]
[DataStream("close", iHandle)]
RETURN PACKET
The “fetch” command returns a single packet string containing the data from all
requested records. The packet includes a header record, followed by one record for
57
Integrating With GoldMine
each record evaluated by “fetch.” Within each record in the packet, the fields are
separated by a Field Delimiter, the carriage return character by default (13 or 0x0D).
The records in the packet are separated by the Record Delimiter, the line feed
character by default (10 or 0x0A). These delimiters are convenient when the
requested data does not contain notes from blob fields. Otherwise, you must
override the default delimiters by passing other delimiter values to the “range” and
“query” commands. The characters 1 and 2 would probably make good delimiters
for packets with notes.
The City Lookup example from above might return a packet of data similar to:
3000-0004
Boston|23
London|393
Los Angeles|633
New York|29
The packet header record consists of two sections. The first byte can be 0, 3
or 4. Zero indicates that more records are available, which could be fetched with
another “fetch” command. A value of 3 indicates the end-of-file (EOF), and 4
indicates the beginning-of-file (BOF). The number following the dash indicates the
total number of data records contained in the packet.
Packets should be designed to be 8K to 32K. DataStream takes about as much time to
read three records as it does to read 30. For best performance, adjust the number to
records requested by the “fetch” command to return packets of 8K to 32K.
PERFORMANCE
DataStream is the fastest way to read data from GoldMine tables. Used correctly, the
GoldMine DataStream will return the data faster than most development
environments would directly. DataStream offers the following advantages:
1. DataStream issues a single, efficient SQL query or Xbase seek to retrieve the
records from the back-end database to the local client. On SQL databases,
requests of a few hundred records could be sent from the server to the client
with a single network transaction, thereby minimizing network traffic.
2. All fields and expressions are parsed initially by the “range” and “query”
commands, then quickly evaluated against each record in the “fetch”
command. Other DDE methods (and development environments) require
that each field be parsed and evaluated each time the field’s data is read. This
can save a significant amount of time when reading hundreds or thousands
of records.
3. Only three DDE calls are required to read all the data. Using traditional
record-by-record querying would require one DDE call for each field of each
record (reading 10 fields from 50 records would require 500 DDE calls).
4. All the work to gather and format the data is done in fast and efficient C. The
caller needs only to parse the resulting packet string.
The “range” and “query” commands execute equally fast on SQL databases. The
“range” command executes much faster on Xbase tables than the “query” command.
58
Integrating With GoldMine
EXAMPLE 3
The following DataStream command returns all e-mail addresses in the current
contact file.
[DataStream("range", "contsupp","contspfd","PINTERNET A","PINTERNET
B","ContSupRef;")]
[DataStream("fetch", 999, 1)]
[DataStream("close", 1)]
To return only the e-mail addresses of people at FrontRange Solutions, add a filter to
the “range” command:
[DataStream("range", "contsupp","contspfd","PINTERNET A","PINTERNET
AZ", "ContSupRef;AccountNo;&Recno();", "'@goldmine.com' $
lower(ContSupRef)")]
EXAMPLE 4
The following DataStream returns all entries from all F2 lookups. The fields are
delimited with a comma, and the records with the default LF.
[DataStream("range", "lookup", "lookup", "A",
"Z","FieldName;Entry;","",",")]
[DataStream("fetch", 2000, 1)]
[DataStream("close", 1)]
EXAMPLE 5
The following DataStream returns the exact packet as the one above, but using an
SQL query:
[DataStream("query", "select fieldname, entry from lookup where
fieldname > 'A' order by fieldname, entry", "",",")]
GoldMine can send a DDE command to process a Web import instruction file. Using
a DDE command allows other applications to create contact records in GoldMine. To
start processing an instruction file via DDE, send the ExecIniImp(<filename>)
command; for example, [ExecIniImp(“c:\goldmine\imp.ini”)].
For details about setting up and working with the GoldMine Web Import Gateway, see
“Capturing Web Data” in Maintaining GoldMine.
The Expr function is similar to the Read function in that it attempts to evaluate an
Xbase expression and return the result as a string. The Expr function, however, does
not require you to open a specific data file using the Open function. The expression
passed to the Expr function is evaluated against the current operating state of
GoldMine (usually, the currently displayed record), rather than the state of a specific
work area. For this reason, you should be aware that differences between the return
values could exist for the same expression passed to Read and Expr.
59
Integrating With GoldMine
PARAMETERS
The Expr function takes one parameter—the Xbase expression to be evaluated.
GoldMine supports a subset of the Xbase dialect, so there is substantial flexibility in
the application of this function. Enclose this parameter in quotation marks (“).
When referencing field names within an expression, you should always use an alias;
otherwise, GoldMine assumes CONTACT1 to be the default alias.
RETURN VALUE
The Expr function returns a character string containing the value of the specified
expression. If an error occurs, or the expression could not be evaluated, the Expr
function will return a null string.
EXAMPLE
The following expression will return the number of characters in notes file of the
current contact.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sExpr As String
Dim sRet As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sExpr = "Length(Contact1->Notes)"
sRet = DDERequest(lChannel, "[EXPR(" + sQ + sExpr + sQ + ")]")
MsgBox ("Notes Length = " + sRet + " characters")
End Sub
PARAMETERS
The FormAddFields function takes two parameters. Enclose each parameter in
quotation marks (“).
The first parameter is the number of the form.
The second parameter is a string that lists fields, macros, and expressions; each item
in the string is separated by a semicolon (;). GoldMine parses the string, checks for
duplication, assigns names to the fields, and then stores the items.
60
Integrating With GoldMine
EXAMPLE
The following example shows how to export a data file with GoldMine. It uses all of
the Formxxxx functions, such as FORMADDFIELDS, FORMNEWFORM,
FORMQUERYCREATE, FORMCLEARFIELDS, FORMCLOSEFORM, and
FORMGETFIELDNAME.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sRet As String
Dim sFieldList As String
Dim sFormNo As String
Dim sFile As String
Dim sNumRecs As String
Dim sMergeCode As String
Dim sQ As String
sMergeCode = ""
sQ = Chr(34)
'Populate the field list
sFieldList = "&Contact ; Phone1 ; Contact1->State ;
SUBSTR(Company,1,5)"
lChannel = DDEInitiate("GoldMine", "Data")
'Get a new Form Number
sFormNo = DDERequest(lChannel, "[FormNewFormNo()]")
'Register the fields
sRet = DDERequest(lChannel, "[FormAddFields(" + sQ + sFormNo + sQ +
"'" + sQ + sFieldList + sQ + ")]")
'Display the field names as assigned by GoldMine
61
Integrating With GoldMine
The FormClearFields function opens an existing form profile and deletes all
associated fields.
PARAMETERS
The FormClearFields function takes one parameter—the number of the form.
Enclose this parameter in quotation marks (").
RETURN VALUE
The FormClearFields function returns 1 if the profile is open, or 0 if an error occurs.
EXAMPLE
See “Adding Merge Fields to a Form” on page 106.
PARAMETERS
The FormCloseForm function takes one parameter, which is the number of the form.
Enclose this parameter in quotation marks (").
EXAMPLE
See “Adding Merge Fields to a Form” on page 106.
The FormCreateFile function creates an Xbase (DBF) file with all registered fields.
Any active filter or group that applies to the contact record is taken into account.
FormCreateFile can be used to export data via DDE.
PARAMETERS
The FormCreateFile function takes four parameters. Enclose all parameters in
quotation marks (").
The first parameter is the number of the form.
62
Integrating With GoldMine
RETURN VALUE
The FORMCREATEFILE function returns the total number of records in the output
.DBF file.
EXAMPLE
See “Adding Merge Fields to a Form” on page 60.
The FormGetFieldName function returns the field name for an expression, a macro,
or a field.
PARAMETERS
The FormGetFieldName function takes two parameters. Enclose both parameters in
quotation marks (").
The first parameter is the number of the form. The second parameter is the name of
the field, macro, or expression to be associated with the file name.
EXAMPLE
See “Adding Merge Fields to a Form” on page 106.
63
Integrating With GoldMine
RETURN VALUE
The FormNewFormNo function returns a new, unique FormNo value that can be
used to register fields not attached to a GoldMine form. Enclose this parameter in
quotation marks (").
EXAMPLE
See “Adding Merge Fields to a Form” on page 106.
PARAMETERS
The FormQueryCreate function takes one optional parameter. Enclose this
parameter in quotation marks (").
The following table lists values of FormQueryCreate parameters.
FormQueryCreate Parameters
Value Description
0 Export in progress (default)
1 Start process
2 Abort process
RETURN VALUE
The FormQueryCreate function returns the number of records created while an
export is in progress, or -1 when the record export process is completed.
EXAMPLE
See “Adding Merge Fields to a Form” on page 106.
PARAMETERS
The InsHistory function takes up to seven parameters. All parameters must be
passed in quotation marks (").
64
Integrating With GoldMine
The first parameter is the account number of the contact record to which the new
history record will be linked.
The second parameter is the record type to create. The following values are available:
InsHistory Valid Values (2nd parameter)
Value Record Type Value Record Type
A Appointment U Unknown
C Phone call CC Call back
D To-do CI Incoming call
E Event CM Returned message
L Form CO Outgoing call
M Sent message MG E-mail message
O Other MI Received e-mail
S Sale MO Sent e-mail
T Next action
RETURN VALUE
The InsHistory function returns the record number (Xbase) or record ID (SQL) of the
new history record if the function was completed successfully. The function returns
0 if a new record could not be appended to the data file.
EXAMPLE
The following example shows how to create a history (incoming call) record for the
current contact.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see “Establishing a DDE Conversation” on page 31.
Sub Main()
Dim lChannel As Long
Dim sAccountNo As String
Dim sRecType As String
Dim sRef As String
65
Integrating With GoldMine
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sAccountNo = DDERequest(lChannel, "Contact1->AccountNo")
sRecType = "CI" 'Incoming Call
sRef = "New History"
sRet = DDERequest(lChannel, "[InsHistory(" + sQ + sAccountNo +
Chr$(34) + "," + Chr$(34) + sRecType + Chr$(34) + "," + Chr$(34) +
sRef + sQ + ")]")
If sRet = "0" Then
StatusBar = "History not Created"
End If
DDETerminate (lChannel)
EndSub
PARAMETERS
The LinkDoc function takes up to six parameters.
The first parameter is the record number of the link record to be updated. If a new
link record is to be created, pass 0 as the first parameter.
When GoldMine calls the mail merge macro, the record number of the linked document
record is passed as the sixth parameter.
The second parameter is the fully qualified path and filename of the file to link. Keep
in mind that a valid association must exist for the file’s extension if GoldMine is to
automatically launch the file’s application. See “Installing the GoldMine DDE Link”
for information on creating a file association using Windows Explorer. Enclose this
parameter in quotation marks (“).
The third parameter is the document title. Enclose this parameter in quotation
marks (“).
The fourth parameter is the optional document owner. If this field is not passed, the
document owner defaults to the name of the currently logged GoldMine user.
The fifth parameter is optional notes for the linked document record in the Links tab.
66
Integrating With GoldMine
The sixth parameter defines the remote synchronization status for the linked
document from the values shown in the following table.
NSync Valid Values
Value Action
-1 Uses the GoldMine default as defined by Allow new documents to sync by default in
the Sync tab of the Preferences window.
0 Does not synchronize the newly linked document.
1 Allows the newly linked document to synchronize.
RETURN VALUE
The LinkDoc function returns the new record number (Xbase) or record ID (SQL) if
the function was completed successfully. The function returns any empty string if a
new record could not be appended to the data file, or an existing record could not be
locked for update.
EXAMPLE
The following example prompts the user for a file name and description, then creates
a document link to the current contact.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see “Establishing a DDE Conversation” on page 31.
Sub Main()
Dim lChannel As Long
Dim sDocPath As String
Dim sTitle As String
Dim sRet As String
Dim sQ As String
sQ = Chr$(34)
lChannel = DDEInitiate("GoldMine", "Data")
sDocPath = InputBox("Enter Full Path of Document to Link")
sTitle = InputBox("Enter Title of Link")
sRet = DDERequest(lChannel, "[LinkDoc( 0," + sQ + sDocPath + sQ +
"," + sQ + sTitle + sQ + ")]")
DDETerminate (lChannel)
End Sub
67
Integrating With GoldMine
PARAMETERS
The MsgBox function accepts two parameters.
The first parameter is the message to display within the dialog box. Enclose this
parameter in quotation marks (").
The second parameter is the optional style of the message box. This value is the sum
of the following options:
MsgBox Style Values (2nd parameter)
Value Meaning
0 Display OK button only
1 Display OK and Cancel buttons
2 Display Abort, Retry, and Ignore buttons
3 Display Yes, No, and Cancel buttons
4 Display Yes and No buttons
5 Display Retry and Cancel buttons
16 Display Stop icon
32 Display Question Mark icon
48 Display Exclamation Mark icon
64 Display Information icon
128 First button is default
256 Second button is default
512 Third button is default
RETURN VALUE
The MsgBox function returns the following values:
MsgBox Return Values
Return Description
1 OK button selected
2 Cancel button selected
3 Abort button selected
4 Retry button selected
5 Ignore button selected
6 Yes button selected
7 No button selected
EXAMPLE
The following example shows how to display a message dialog box in GoldMine and
return the result.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
68
Integrating With GoldMine
Sub Main()
Dim lChannel As Long
Dim sRet As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sRet = DDERequest(lChannel, "[MsgBox(" + sQ + "Press a Button, Any
Button" + sQ + ", 4)]")
If ret$ = "6" Then
MsgBox ("Yes was pressed")
Else
MsgBox ("No was pressed")
End If
DDETerminate (lChannel)
End Sub
The NewForm function adds a merge template record into the Merge Forms window
in GoldMine. This function is used primarily by the document merge link
installation macro; however, the function can also be used to add additional merge
templates from a user-written application.
PARAMETERS
The NewForm function takes up to six parameters; the first three parameters are
required, and the last three parameters are optional.
The first parameter is the type of document to which the new form record will point.
This value must be a valid Application Identifier, such as Word.Document.6, that
corresponds to an entry in the Registration Database. Enclose this parameter in
quotation marks (").
The second parameter is the fully qualified path and filename of the template file.
The third parameter is the title of the document as it should appear in the Merge
Forms browse window. Enclose this parameter in quotation marks (").
The fourth parameter is the name of an optional DDE function to be called after the
template is loaded by the linked application. If this parameter is not specified, the
default function is MAINMENU. Enclose this parameter in quotation
marks (").
69
Integrating With GoldMine
The fifth parameter is the optional type of template. If this parameter is not specified,
the template type is assumed to be Document. Enclose this parameter in quotation
marks ("). GoldMine accepts the following values for this parameter:
Document Types
Type Description
0 Document
1 Spreadsheet
2 Other
The sixth parameter is a three-character field corresponding to the values of the Link
To Doc, Save History and Allow Hot Link options on the Form Setup dialog box. To set
(check) one of these options, 1 is passed; to reset (uncheck), 0 is passed. Enclose this
parameter in quotation marks (“).
Flag Values
Position Description
0 Link To Doc check box
1 Save History check box
2 Allow Hot Link check box
RETURN VALUE
The NewForm function returns a form number.
EXAMPLE
The following example shows how to create a merge form entry in GoldMine, using
the currently active Word Document.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Public Sub Main()
Dim sQ As String
Dim lChannel As Long
Dim iResult As Integer
Dim sDocTitle As String
Dim sFullName As String
Dim sAppName As String
Dim FSDlg As Dialog
70
Integrating With GoldMine
End If
lChannel = DDEInitiate("GoldMine", "Data")
iResult = Dialogs(wdDialogFileSummaryInfo).Show
If iResult = 0 Then
GoTo Bye
End If
sDocTitle = sQ + Dialogs(wdDialogFileSummaryInfo).Title + sQ
iResult = Dialogs(wdDialogFileSaveAs).Show
If iResult = 0 Then
GoTo Bye
End If
ActiveDocument.Save
sFullName$ = sQ + ActiveDocument.FullName + sQ
sAppName = sQ + "[GoldMineLink()]" + sQ
FormNo$ = DDERequest(lChannel, "[NewForm(Word.Document.8," +
sFullName$ + "," + sDocTitle$ + "," + sAppName + ")]")
ActiveDocument.Saved = False
ActiveDocument.SaveAs FileName:=sFullName$,
FileFormat:=wdFormatTemplate
StatusBar = "Document has been saved as a GoldMine Merge Form"
Bye:
If lChannel Then
DDETerminate lChannel
End If
End Sub
Creating a Group
Syntax [NE WGROUP(<ref>,<code>,<user>)]
The NewGroup function is used to create an empty group. This function must be
called prior to adding group members with the NewMember function.
PARAMETERS
The NewGroup parameter takes up to three parameters; the first parameter is
required, the last two are optional.
The first parameter is the Reference for the new group. Enclose this parameter in
quotation marks (“).
The second parameter is the optional sort Code for the group. This parameter must
be passed in quotation marks if it contains any embedded spaces or delimiting
marks.
The third parameter is the optional user name to whose groups list the new group
will be added. If this parameter is not passed, the new group will be added to the
currently logged user’s list of groups. Enclose this parameter in quotation
marks (“).
71
Integrating With GoldMine
RETURN VALUE
The NEWGROUP function returns a value representing the GROUP NUMBER of the
new group. Zero is returned if the group could not be added. The GROUP NUMBER
value is used by the NewMember function to add members to the new group.
EXAMPLE
The following example shows how to create a group called “New Group” and make
the current contact a member of that group.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sGroupNo As String
Dim sAcountNo As String
Dim sQ As String
Dim sRet As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sGroupNo = DDERequest(lChannel, "[NewGroup(" + sQ + "New Group" + sQ
+ "," + sQ + "New" + sQ + ")]")
If sGroupNo <> “0” Then
sAccountNo = DDERequest(lChannel, "Contact1->AccountNo")
sRet = DDERequest(lChannel, "[NewMember(" + sQ + sGroupNo + sQ +
"," + sQ + sAccountNo + sQ + "," + sQ + "New Member" + sQ + "," + sQ
+ "Sort" + sQ + ")]")
If sRet = "" Then
StatusBar = "Error Creating New Member"
Else
StatusBar = "Group Created and Member Added. "
End If
Else
StatusBar = "Error Creating New Group"
End If
DDETerminate (lChannel)
End Sub
The NewMember function is used to add a member to a group created with the
NewGroup function.
72
Integrating With GoldMine
PARAMETERS
The NewMember function takes up to four parameters; the first two parameters are
required, and the last two are optional.
The first parameter is the GROUP NUMBER of the group to which the member will
be added. This value is returned by the NewGroup function. Enclose this parameter
in quotation marks (").
The second parameter is the account number of the contact record to add to the
group. Enclose this parameter in quotation marks (").
The third parameter is the optional group member Reference. Enclose this parameter
in quotation marks (").
The fourth parameter is the optional group member sort Code. Group members are
ordered alphabetically by the value in this field. Enclose this parameter in quotation
marks (").
EXAMPLE
See “Creating a Group” on page 71.
Creating a Macro
Syntax [PLAYM ACRO(<Macro>,<wait>)]
PARAMETERS
The PlayMacro function takes two parameters that identify the macro and assign a
wait state.
The first parameter identifies the macro. Either the number for the currently logged
user or a valid macro filename can be used to identify a macro.
For details about creating a macro from the GoldMine toolbar, see “Customizing the
GoldMine Toolbar” in the online Help.
73
Integrating With GoldMine
RETURN VALUE
The PlayMacro function returns an integer value based on the wait parameter; that
is, GoldMine availability to process a task in addition to the currently running
macro. If the wait parameter is 0 (GoldMine does not wait for the macro to finish to
process another task), the PlayMacro function will always return 1. If the wait
parameter is 1 (GoldMine will wait for the current macro to finish before processing
another macro or task), the PlayMacro function will return either 0 or 1 under the
following conditions:
PlayMacro Return Values
Return Description
0 Error occurred during macro playback
1 Macro played successfully
EXAMPLE
The following example shows how to play back a macro via DDE.
To prevent unwanted macros from being executed, some parts of this example have
been commented out.
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see “Establishing a DDE Conversation” on page 31.
Sub Main()
Dim lChannel As Long
Dim sRet As String
Dim sQ As String
sQ = Chr(34)
'un comment the following line to execute
'lChannel = DDEInitiate("GoldMine", "Data")
74
Integrating With GoldMine
End Sub
You can also play a macro from the command line (DOS prompt). Executing a macro from the
command line can be useful in running functions at night, such as indexing, running an Automated
Process, or synchronizing with remote sites with a transfer set created via macro. You can either
identify a macro by an identification number, like GMW4 /m:801, or by file name like GMW4 /m:c:
\index.801. If necessary, the command line statement can start GoldMine and then, once started,
run the macro.
If running the Plus! Pack with Windows, you can run a macro from the System Agent by placing a
command line switch for GoldMine in the Program field of the Schedule a New Program dialog box
that will run a macro. For example, to log in John with his username and password, then run John’s
first macro, place the following macro in the System Agent:
Where GMW5/ starts Goldmine, u:john/ is login user John, p:pswd/ enters the password
password, and m:800 runs first macro.
The SendPage function allows you to create and send a message to the pager of a
GoldMine user. The function consists of the following components:
<Message> can consist of any text message that you create with this function to send
to a pager; most pages can accept messages of
70–100 characters.
<From> includes the sender’s name as an optional “signature.”
<To> identifies an optional GoldMine user who will receive the pager message.
Information about the pager must be entered in the Edit|Preferences|Pager tab, such
as ID code or PIN number, telephone number of the pager, and maximum message
size in characters that the pager can accept.
RETURN VALUE
The SendPage function can return one of two values.
SendPage Return Values
Return Description
0 Error occurred during the attempt to send the message to the pager
1 Pager message was transmitted successfully
75
Integrating With GoldMine
EXAMPLE
The following example sends the message “This is a pager message” from John Doe:
Note that the example below is written in Visual Basic for Applications, and the
DDEInitiate and DDERequest functions are not a part of Visual Basic 6.0. DDE
functionality is performed via the LinkRequest method in a textbox. For more
information, see Establishing a DDE Conversation on page 31.
Sub Main()
Dim lChannel As Long
Dim sMsg As String
Dim sFrom As String
Dim sRet As String
Dim sQ As String
sQ = Chr(34)
lChannel = DDEInitiate("GoldMine", "Data")
sMsg = "This is a pager message"
sFrom = "Jon Doe"
sRet = DDERequest(lChannel, "[SendPage(" + sQ + sMsg + sQ + "," + sQ
+ sFrom + sQ + ")]")
End Sub
PARAMETERS
The StatusMsg function takes two parameters. Enclose each parameter in quotation
marks (").
First parameter is the message.
Second parameter is an optional delay, after which time the message is removed
from the status bar.
EXAMPLE
See “RecNo” on page 42.
76
Integrating With GoldMine
PARAMETER
The SyncStamp function takes one parameter. Enclose the parameter in quotation
marks (").
RETURN VALUES
When the <stamp> string parameter is exactly 17 characters long, formatted as
Date:Time in form of CCYYMMDD:HH:MM:SS, the return string is in TLog time
stamp format, exactly seven characters long. When the <stamp> parameter is seven
characters long, and formatted as a TLog timestamp, the return string is formatted as
CCYYMMDD:HH:MM:SS. An empty return string indicates an error.
EXAMPLE 1
The following example converts February 1, 1998 at 7:01 p.m. to a TLog time stamp
format.
[SyncStamp("19980201:19:01:30")] returns "+#G><N2"
EXAMPLE 2
The following example converts a TLog time stamp format to the date and time of
February 1, 1998 at 7:01 p.m.
[SyncStamp("+#G><N2")]
returns "19980201:19:01:30"
DDE Macros
To facilitate the use of DDEAUTO fields, GoldMine allows you to select a macro as
the service item. Upon encountering a DDE service item that starts with an
ampersand (&), GoldMine searches an internal table of macro names. If a match is
found, the macro is processed and the result is returned, as if a DDE function or
expression had been used.
Most macros are sensitive to the setting of the RECORDOBJ function’s SETRECORD
subfunction. This DDE function is used primarily to gain access to additional
contacts and other supplementary information. When the SETRECORD type is set to
PRIMARY, the following macros will return the value from the corresponding fields
in the primary information portion of the contact record. When the SETRECORD
type is set to CONTACTS (additional contacts), or another supplementary record
type, the macros will return the value from the corresponding field in the
supplementary file (CONTSUPP.DBF).
The following macros can be used as DDE service items:
77
Integrating With GoldMine
&Address1 Returns the first Address field from the active contact record. Typically, this
value will be extracted from the Address1 field in the primary display
portion of the contact record; however, when the RECORDOBJ
SETRECORD subfunction has been used to change the returned record
type to CONTACTS, then GoldMine returns the value from the Address1
field on the additional contact record, if a value is entered. When the
Address1 field on the additional contact record is blank, then the
&Address1 macro returns the value in the Address1 field in the primary
display portion of the contact record. When the RECORDOBJ
SETRECORD type is set to return a record type other than CONTACTS,
the &Address1 macro returns the value in Address1 field in the primary
display portion of the contact record.
&Address2 Returns the second Address field from the active contact record. Typically,
this value will be extracted from the Address2 field in the primary display
portion of the contact record; however, when the RECORDOBJ
SETRECORD subfunction has been used to change the returned record
type to ADDITIONAL, then GoldMine returns the value from the Address2
field on the additional contact record, if an entry exists in the Address2 field
on the additional contact record. When the Address2 field on the additional
contact record is blank, then the &Address2 macro returns the value in the
Address2 field in the primary display portion of the contact record. When
the RECORDOBJ SETRECORD type is set to return a record type other
than PRIMARY or ADDITIONAL, the &Address2 macro returns the value
in the Address2 field of the primary display portion of the contact record.
&BrowseRecNo Xbase: Returns the record number of the last selected record in a browse
window.
SQL: Returns the record ID of the last selected record in a browse window.
&CalRefresh Refreshes the graphical calendar display. Set up GoldMine to run this
macro after adding calendar records using DDE.
&City Returns the City field from the active contact record. The action of this
macro string is similar to the action of &Address1. The &City macro can
be used to return an additional contact city by using the RECORDOBJ
SETRECORD subfunction.
&CityStateZip Returns a format string of text containing the City, State, and Zip fields
from the active contact record. This string is returned in the following format:
City, State Zip
The action of this macro string is similar to the action of &Address1. The
&CityStateZip macro can be used to return an additional contact city,
state, and ZIP Code by using the RECORDOBJ SETRECORD
subfunction.
78
Integrating With GoldMine
&CommonDir Xbase: Returns the path information for the directory where the contact
sets are located.
SQL: Returns the BDE alias where the contact sets are located.
&Contact Returns a Contact name from the active contact record. Normally, this
value will be extracted from the Contact field in the primary display portion
of the contact record; however, the RECORDOBJ SETRECORD
subfunction can be used to change the returned record type to additional
contact, or another type of supplementary record. When the RECORDOBJ
SETRECORD type is set to return record types other than PRIMARY, the
&Contact macro returns the value in Contact field in CONTSUPP for the
current supplementary record.
&Country Returns the Country field from the active contact record. The action of this
macro string is similar to the action of &Address1. The &Country macro can
be used to return an additional contact country by using the RECORDOBJ
SETRECORD subfunction.
&Dial1 Returns the Phone1 entry from the active contact record. The returned
phone number is formatted for dialing. GoldMine applies the same rules
used to dial the phone via TAPI. If selected, PREDIAL.INI settings are
applied to phone number selection.
&Dial2 Returns the Phone2 entry from the active contact record. For details, see
&Dial1 above.
&Dial3 Returns the Phone3 entry from the active contact record. For details, see
&Dial1 above.
&DialFax Returns the FAX entry from the active contact record. For details, see
&Dial1 above.
&EmailAddress Returns the primary e-mail address for the currently selected contact.
&Fax Returns the fax number as it should be sent to an auto-dialer for automatic
fax transmission.
&FullAddress Returns a string containing the complete address for the contact record,
composed of values of &Address1, &Address2, &City, &State, and &ZIP.
The action of this macro string is similar to the action of &Address1. The
&FullAddress macro can be used to return an additional contact address by
using the RECORDOBJ SETRECORD subfunction.
79
Integrating With GoldMine
&GetRoTabID Returns the ID of the currently selected tab. Typically, this value will verify
that the correct tab is selected when a user starts a custom application.
0 = Summary
1 = Fields
2 = GM+View
3 = Notes
4 = Contacts
5 = Details
6 = Referral
7 = Pending
8 = History
9 = Links
10 = Members
11 = APs/Tracks
12 = Opportunities
13 = Projects
14 = Relationships/Org tree
15 = Cases
16 = HEAT View if installed, else it will go to the first tab
17+ = custom if installed, otherwise the first tab
&GetRoTabPos Returns the currently selected tab position. Since the tabs can be
rearranged, this method is not always reliable for determining the currently
selected tab. For details, see &GetRoTabID.
&GoldDir Xbase: Returns path information for the directory in which GoldMine is
installed.
SQL: Returns path information for BDE alias in which GoldMine is installed.
&LicUsers Returns the number of concurrent users allowed to log in to the installed
copy of GoldMine.
&LicUsersAvailable Returns the number of users allowed to log in to the installed copy of
GoldMine license.
80
Integrating With GoldMine
&NameAddress Returns a string containing the contact’s name, company, and complete
address of the current contact record. Each address line is separated by a
carriage return and line feed, and the entire string is formatted so that the
string can be inserted directly into a merge template. If any of the address
lines on the contact record is empty, that address line will be suppressed.
This macro can be used to perform rudimentary blank line suppression
within linked applications that do not support blank address line
suppression internally.
The action of this macro string is similar to the action of the &ADDRESS
macros, and the &NAMEADDRESS macro can be used to return an
additional contact address by using the RECORDOBJ SETRECORD
subfunction.
&NameTitleAddress Returns a string containing the contact’s name, title, department, company,
and complete address of the current contact record. Each line is separated
by a carriage return and line feed, and the entire string is formatted so that
the string can be inserted directly into a merge template. If any of the lines
on the contact record is empty, that line will be suppressed. This macro can
be used to perform rudimentary blank line suppression within linked
applications that do not support blank address line suppression internally.
The action of this macro string is similar to the action of the &ADDRESS
macros, and the &NAMETITLEADDRESS macro can be used to return an
additional contact address by using the RECORDOBJ SETRECORD
subfunction.
&NewRecID Returns a unique record ID, which can be used when creating new records.
&Notes Returns the Notes from the active contact record. Typically, this value will
be extracted from the Notes field in the primary display portion of the
contact record; however, the RECORDOBJ SETRECORD subfunction can
be used to change the returned record type to additional contact, or another
type of supplementary record. When the RECORDOBJ SETRECORD type
is set to other than PRIMARY, the &TITLE macro returns the value in Notes
field in CONTSUPP for the current supplementary record.
81
Integrating With GoldMine
82
Integrating With GoldMine
&RoTabPage Returns the currently selected tab. Typically, this value will verify that the
correct tab is selected when a user starts a custom application. Values
between 1 and 9 represent tabs in the first row of tabs; for example, 1
represents the Summary tab. Values between 10 and 18 represent tabs in
the second row, and 19–27 represent tabs in the third row.
The following example tests the selection of the fifth (Profiles) tab:
ch=DDEInitiate(“GoldMine”, “Data”)
If DDERequest$(Ch, “&RoTabPage”) <> “5” Then
MsgBox “You must select a profile record
first”
End If
&SetRoTab# Selects the tab that corresponds to the number (represented by #) in the
active contact record.
1 = Summary
2 = Fields
3 = GM+View
4 = Notes
5 = Contacts
6 = Details
7 = Referral
8 = Pending
9 = History
10 = Links
11 = Members
12 = APs/Tracks
13 = Opportunities
14 = Projects
15 = Relationships/Org tree
16 = Cases
17 = HEAT View if installed, else it will go to the first tab
18+ = custom if installed, otherwise the first tab
ch=DDEInitiate(“GoldMine”, “Data”)
DDERequest$(Ch, “&SetRoTab4”)
&ShutDown Logs out the currently logged user, and quits GoldMine.
&State Returns the State field from the active contact record. The action of this
macro string is similar to the action of the &ADDRESS1. The &STATE
macro can be used to return an additional contact state by using the
RECORDOBJ SETRECORD subfunction.
83
Integrating With GoldMine
&Title Returns the Title from the active contact record. Normally, this value will be
extracted from the Title field in the primary display portion of the contact
record; however, the RECORDOBJ SETRECORD subfunction can be
used to change the returned record type to additional contact, or another
type of supplementary record. When the RECORDOBJ SETRECORD type
is set to other than PRIMARY, the &TITLE macro returns the value in Title
field in CONTSUPP for the current supplementary record.
&User_Var Returns the defined field value from all users, a specified user, or the
currently logged user. For details on defining values, see “Defining Field
Values for use with External Applications” in Maintaining GoldMine.
The &User_Var macro allows GoldMine users to store specific data that
can be retrieved later into applications that are linked via DDE with
GoldMine. This macro can be defined in the [user_var] section of both the
GM.INI and the username.INI of GoldMine.
Usage Syntax:
&User_Var.<variable name>.<GoldMine username>
Example:
&User_Var.Territory.Dan
(Where <variable name> is a descriptive name of the macro and
<GoldMine username> assigns a defined value to a specific GoldMine
user.) <GoldMine username> is optional, as GoldMine will assign these
values to the current GoldMine user.
&UserFullName Returns the full name of the currently logged GoldMine user as the name
appears in the FullName field in the Users Master File for the user.
&UserName Returns the login name of the currently logged GoldMine user.
&ZIP Returns the Zip field from the currently active contact record. The action of
this macro string is similar to the action of the &ADDRESS1. The &ZIP
macro can be used to return an additional contact ZIP Code by using the
RECORDOBJ SETRECORD subfunction. The DDE macro can be used to
reindex or rebuild the database.
&PARAM1 Returns the path and filename of the document template associated with the merge
(filename) form selected when Edit, Link, Print, or Fax was selected. This value is obtained
from the Template File field in the merge form’s Form Setting dialog box.
&PARAM2 Returns a value indicating whether the Edit, Link, Print, or Fax button was selected
(action) to launch linked application.
84
Integrating With GoldMine
&PARAM2 Parameters
Value Description
1 Edit selected
2 Link selected
3 Print selected
4 Fax selected
&PARAM3 Returns a value corresponding to the setting of the Record Range options on the
(range) Merge Forms dialog box when the Edit, Link, Print, or Fax button was selected.
&PARAM3 Parameters
Value Description
1 This contact selected
2 All contacts selected
3 Forward to last selected
&PARAM4 Returns a value corresponding to the setting of the Primary and Additional check
(scope) boxes on the Merge Forms dialog box when the Edit, Link, Print, or Fax button
was selected.
&PARAM4 Parameters
Value Description
1 Primary checked
2 Additional checked
3 Both Primary and Additional checked
&PARAM5 Returns a value corresponding to the status of the Link to Doc, Save History,
(flags) and/or Allow Hot Link check boxes on the Merge Forms dialog box. In addition,
the returned value determines whether the form was merged as the result of an
Automated Processes action.
Returns a seven-character string. Each position of the string can contain either 0,
indicating the item was not checked (or Automated Processes is not active), or 1,
indicating the item was checked (or Automated Processes is active).
&PARAM5 Parameters
Position Description
1 Link to Doc
2 Save History
3 Allow Hot Link
4 Unused
5 Unused
6 Unused
7 Automated Processes status
85
Integrating With GoldMine
&PARAM6 Returns a value containing the record number of the last Linked Document
(LinkDoc supplementary record created as a result of launching a Merge Form. When you
record launch a merge form with Link to Doc selected, GoldMine creates a linked
number) document record to hold the saved document. This value can be saved and used to
update the linked document record by passing the record number to the LinkDoc
DDE function.
&PARAM7 Returns a pointer to a minimized contact record that is created when Print or Fax is
(contact selected on the Merge Forms dialog box, and the Record Range is All Contacts
record or Forward to Last. This value can then be passed to the RecordObj function to
pointer) further control a document merge from the linked application.
&PARAM8 Returns the merge code entered in the Merge code field of the Merge Forms
(merge code dialog box.
value)
&PARAM9 Returns the RecNo or RecID of the history record created by GoldMine. This macro
(history is useful for updating the history record.
record)
86
Integrating With GoldMine
&LicInfo_Contact Returns the Contact Name entry from the registration form.
&LicInfo_LicEmail Returns the E-mail address entry from the registration form.
&LicInfo_Phone Returns the telephone number entry from the first Phone/Fax field.
&LicInfo_Fax Returns the fax number entry from the second Phone/Fax field.
&LicInfo_City Returns the city entry from the first City/State field.
&LicInfo_State Returns the state or province entry from the second City/State field.
&LicInfo_Zip Returns the ZIP Code entry from the first Zip/Country field.
&LicInfo_Country Returns the country entry from the second Zip/Country field.
87
Using GMXS32.DLL for Database
Access and Sync Log Updates
The GoldMine GMXS32.DLL is a standard dynamic-link library (DLL) that offers
developers efficient methods to access GoldMine databases and update GoldMine
synchronization logs when external applications update GoldMine data. Most
development environments can load GMXS32.DLL. GoldMine does not need to run
to use GMXS32.DLL.
GMXS32.DLL installs into the \WINDOWS\SYSTEM directory automatically with
GoldMine. Therefore, third-party developers do not need to distribute GMXS32.DLL
with their applications.
The actual file name for the API will vary depending on the version of GoldMine.
For versions of GoldMine in the 5.0 ranges, the dll is named GM5S32.DLL. For
versions in the 6.0 ranges, the dll is named GM6S32.DLL
For an in-depth discussion on interfacing with GoldMine, visit the
Public.GoldMine.Programming newsgroup, which you can access directly from the
GoldMine Web site at http://www.frontrange.com.
This document contains the information you need to:
• Load and initialize GMXS32.DLL
• Streamline integration with GoldMine
• Work with DataStream functions
89
Integrating With GoldMine
METHOD 1: UPDATING A CONTACT RECORD USING THE LOW LEVEL FUNCTIONS OR DDE
1. Open the Contact1 database.
2. Set the index tag.
3. Seek the contact record.
4. If not found, then Append a new record.
5. Replace field values.
6. Close the database.
90
Integrating With GoldMine
Note: As of GoldMine Version 7.0, the Borland Database Engine is no longer used.
References to BDE in the following sections apply only to integrations
developed in GoldMine Version 6.7 or lower.
For GoldMine Version 6.7 or lower:
The GMW_LoadBDE function must be called to load the BDE and initialize the
database objects. The GMW_UnloadBDE() function must always be called before
terminating the application and freeing the DLL.
The following functions initialize and close the BDE sessions:
• GMW_LoadBDE: loads a BDE session
91
Integrating With GoldMine
SYNTAX
PARAMETERS
The GMW_SetSQLUserPass function takes two parameters:
szUserName: specifies the SQL login name.
szPassword: specifies the SQL login name’s password.
RETURN VALUES
The GMW_SetSQLUserPass function returns the following values:
GMW_SetSQLUserPass Return Values
Return Description
0 Failure
1 Success
EXAMPLE
GMW_SetSQLUserPass("JON", "MyPASSWORD");
PARAMETERS
The GMW_LoadAPI function takes five parameters.
SzGoldDir: Specifies the location of CAL.DBF.
SzCommonDir: Specifies the location of CONTACT1.DBF.
SzUser: Specifies the GoldMine user name (must be UPPERCASE).
For API version 5.70.20222 and later: You may set this parameter to the value of
*DDE_LOGIN_CREDENTIALS* to use login credentials returned for the user logged
into a running copy of GoldMine through DDE. For GoldMine 6.7 or higher, you
may also use the UI API equivalent.
SzPassword: Specifies the user’s password (must be UPPERCASE).
For API version 5.70.20222 and later: You may set this to the return string from the
92
Integrating With GoldMine
RETURN VALUES
The GMW_LoadAPI function returns the following values:
GMW_LoadBDE Return Values
Return Description
1 Success
0 API already loaded
-1 API failed to load
-2 Cannot find license file
-3 Cannot load license file
-4 Cannot validate the license file username/password
-5 Invalid GoldDir
-6 Invalid CommonDir
-7 Failed to allocate the needed TLS slot
-8 General Failure
-9 No access to specified contact set for this user
NOTES
GMW_LoadAPI must be called before calling any function that accesses databases,
such as GMW_UpdateSyncLog and GMW_ReadImpTLog. GMW_UnloadAPI must
be called before unloading the DLL. GMW_LoadAPI may be called as many times as
necessary. Be sure to match a corresponding GMW_UnloadAPI for every call of
GMW_LoadAPI.
EXAMPLE
GMW_LoadAPI( "d:\\GM4", "d:\\GM4", "d:\\GM4\\demo", "JON", “PASS” );
Or
GMW_LoadAPI("d:\\GM4", "d:\\GM4", "d:\\GM4\\demo",
“*DDE_LOGIN_CREDENTIALS*”, szDDEReturnString);
PARAMETERS
The GMW_LoadBDE function takes five parameters.
93
Integrating With GoldMine
RETURN VALUES
The GMW_LoadBDE function returns the following values:
GMW_LoadBDE Return Values
Return Description
1 Success
0 BDE already loaded
-1 BDE failed to load
-2 Cannot find license file
-3 Cannot load license file
-4 Cannot validate the license file username/password
-5 Invalid GoldDir
-6 Invalid CommonDir
-7 Failed to allocate the needed TLS slot
-8 General Failure
-9 No access to specified contact set for this user
NOTES
GMW_LoadBDE must be called before calling any function that accesses databases,
such as GMW_UpdateSyncLog and GMW_ReadImpTLog. GMW_UnloadBDE must
be called before unloading the DLL. GMW_LoadBDE may be called as many times
as necessary. Be sure to match a corresponding GMW_UnloadBDE for every call of
GMW_LoadBDE.
EXAMPLE
GMW_LoadBDE( "d:\\GM4", "d:\\GM4", "d:\\GM4\\demo", "JON", “PASS” );
Or
GMW_LoadBDE("d:\\GM4", "d:\\GM4", "d:\\GM4\\demo",
“*DDE_LOGIN_CREDENTIALS*”, szDDEReturnString);
94
Integrating With GoldMine
Logging in a User
GMW_Login may be used to login a different user than was originally logged in
through GMW_LoadAPI or GMW_LoadBDE.
SYNTAX
PARAMETERS
szUser: Specifies the GoldMine user name (must be UPPERCASE).
For API version 5.70.20222 and later: You may set this parameter to the value of
*DDE_LOGIN_CREDENTIALS* to use login credentials returned for the user logged
into a running copy of GoldMine through DDE.
szPassword: Specifies the user’s password (must be UPPERCASE).
For API version 5.70.20222 and later: You may set this to the return string from the
GetLoginCredentials DDE command if the User parameter is set to
*DDE_Login_Credentials*. The credential string is only valid for 30 seconds.
szSQLUser: Specifies the user’s SQL login name. Omit if using DDE login
credentials.
szSQLPassword: Specifies the user’s SQL password. Omit if using DDE login
credentials.
RETURN VALUES
The GMW_Login function returns the following values:
GMW_Login Return Values
Return Description
1 Success
0 Failure
-1 User does not have permission to open the current contact set.
EXAMPLE
GMW_Login( "JOE", "PASS", "SA", "");
Or
GMW_Login(“*DDE_LOGIN_CREDENTIALS*”, szDDEReturnString);
95
Integrating With GoldMine
RETURN VALUES
The GMW_UnloadAPI function returns the following values:
GMW_UnloadBDE Return Values
Return Description
0 Failure
1 Success
NOTES
If GMW_LoadAPI is called, GMW_UnloadAPI must be called before unloading the
DLL.
EXAMPLE
GMW_UnloadAPI();
The following functions perform additional functions:
GMW_GetLicenseInfo: Returns GoldMine licensing information
RETURN VALUES
The GMW_UnloadBDE function returns the following values:
GMW_UnloadBDE Return Values
Return Description
0 Failure
1 Success
NOTES
If GMW_LoadBDE is called, GMW_UnloadBDE must be called before unloading the
DLL.
EXAMPLE
GMW_UnloadBDE();
The following functions perform additional functions:
GMW_SetSQLUserPass: Sets the SQL database login name and password
96
Integrating With GoldMine
Logging In
To log in multiple users, use the GMW_MULogin function. Logging in a user with
this function will use a seat of your GoldMine license.
SYNTAX
PARAMETERS
szUser is the GoldMine login name
szPassword is the GoldMine password
szSQLUser is the username for the MS SQL server
szSQLPassword is the password for the MS SQL server
szCommondir is to set a different, specific contact file directory for this user
RETURN VALUES
The GMW_MULogin function returns the following values:
GMW_MULogin Return Values
Return Description
97
Integrating With GoldMine
Return Description
Logging Out
To log out a user when multiple users are logged in, use the GMW_MULogout
function. This function will free the license seat previously used by the
GMW_MULogin function.
SYNTAX
PARAMETERS
nSessionID is the integer value returned by the GMW_MULogin function
RETURNS
The function will return TRUE if the specified SessionID was valid.
SYNTAX
PARAMETERS
nSessionID is the integer value returned by the GMW_MULogin function and
specifies which login session under which you want the API calls to operate.
RETURNS
The function returns the SessionID on success, and 0 on failure.
98
Integrating With GoldMine
the case with Internet Information Server. If you try to access an API session from a
different thread than the one that created the session, you may encounter exceptions.
To handle these situations, use the GMXTP.DLL. Each of the functions in the
GMXS32.DLL is wrapped through the GMXTP.DLL, so there is no need to load both.
In addition, the above multiple login functions have slightly altered names:
GMW_TP_MULogin
GMW_TP_MULogout
GMW_TP_MUBeginSession
In addition, there is one additional function to be aware of,
GMW_TP_CopySecurityTokentoWorkthread.
SYNTAX
This function ensures that the thread that is attempting access gets the identity of the
working thread instead of the process. This function is especially important when
dealing with IIS Extensions.
NOTES
• These functions require that you are successfully logged into a GoldMine
database using the GMW_LoadAPI or GMW_LoadBDE function.
• You must pass an empty NV container with all calls that do not take any parameters.
Creating an NV Container
GMW_NV_Create creates an NV container. This is the first step in using the
name/value pair containers. This is analogous to creating a structure to store
multiple variables indicating the values you wish to assign to fields in GoldMine.
99
Integrating With GoldMine
SYNTAX
EXAMPLE
lGMNV = GMW_NV_Create
RETURN VALUE
Pointer to a new NV container
SYNTAX
EXAMPLE
lGMNV2 = GMW_NV_CreateCopy(pGMNV)
RETURN VALUE
Pointer to a new NV container.
SYNTAX
PARAMETERS
hgmnvDestination is the pointer to the destination container.
hgmnvSource is the pointer to the source container.
100
Integrating With GoldMine
EXAMPLE
GMW_NV_Copy lGMNV2, lGMNV
RETURN VALUE
n/a
Deleting an NV Container
GMW_NV_Delete deletes an NV container and releases its memory. Be sure to call
this for all previously created containers before exiting your application.
SYNTAX
EXAMPLE
GMW_NV_Delete lGMNV
RETURN VALUE
n/a
SYNTAX
PARAMETERS
hgmnv is the pointer to a valid name value container
Name is the name of the value to return
DefaultValue is the default value if <Name> is null or does not exist.
101
Integrating With GoldMine
EXAMPLE
sValue = GMW_NV_GetValue (lGMNV, ‘Accountno’, ‘(none)’)
RETURN VALUES
The value of the Name is returned. If the Name is null or does not exist, the
DefaultValue value is returned.
SYNTAX
PARAMETERS
hgmnv is the pointer to a valid name value container.
Name is the name of the value to set.
Value is the value to assign to <Name>.
EXAMPLE
GMW_NV_SetValue lGMNV, ‘Phone1’, ‘(310)555-1212’
RETURN VALUE
n/a
SYNTAX
PARAMETERS
hgmnv is the pointer to a valid name value container.
Name is the name of the value to set.
102
Integrating With GoldMine
EXAMPLE
iResult = GMW_NV_NameExists (lGMNV, ‘Phone1’)
RETURN VALUES
SYNTAX
PARAMETERS
hgmnv is the pointer to a valid name value container
Name is the name of the value to set
EXAMPLE
GMW_NV_EraseName lGMNV, ‘Phone1’
RETURN VALUE
n/a
SYNTAX
PARAMETER
hgmnv is the pointer to a valid name value container.
103
Integrating With GoldMine
EXAMPLE
GMW_NV_EraseAll lGMNV
RETURN VALUE
n/a
SYNTAX
PARAMETER
hgmnv is the pointer to a valid name value container.
EXAMPLE
iCount = GMW_NV_Count lGMNV
RETURN VALUE
Number of NVs within the specified container.
Finding an NV Name
GMW_NV_GetNameFromIndex finds the name of the NV stored at a specific index
within the container. The first item in the container is at index value 1.
SYNTAX
PARAMETERS
hgmnv is the pointer to a valid name value container
Index is the item number to return.
EXAMPLE
sName = GMW_NV_GetNameFromIndex(lGMNV, 3)
RETURN VALUE
The name stored at <Index> within the container.
104
Integrating With GoldMine
Finding an NV Value
GMW_NV_GetValueFromIndex finds and returns the value of the NV stored at the
specified index within the container. The first item in the container is stored an index
value 1.
SYNTAX
PARAMETERS
hgmnv is the pointer to a valid name value container
Index is the item number to return
EXAMPLE
sValue = GMW_NV_GetValueFromIndex(pGMNV, 3)
RETURN VALUE
The value stored at <Index> within the container.
Setting NV Pairs
GMW_NV_SetStr sets one or more Name/Value pairs. This function is used if you
would like to set multiple name/value pairs in a single call.
SYNTAX
PARAMETERS
hgmnv is the pointer to a valid name value container.
DlmName is the delimiter between the name and its value.*
DlmVal is the delimiter between each NV pairs.*
ValueStr is the string containing the name values.
EXAMPLE
GMW_NV_SetStr lGMNV,'=',';','Company=GoldMine;Key1=Cust'
GMW_NV_SetStr lGMNV,'&','&','Company&GoldMine&Key1&Cust'
105
Integrating With GoldMine
RETURN VALUE
n/a
SYNTAX
PARAMETERS
FuncName is one of the various business logic functions described below.
hgmnv is the pointer to a Name/Value container.
EXAMPLE
GMW_Execute “WriteContact”, lGMNV
RETURN VALUES
>0 Success
106
Integrating With GoldMine
SYNTAX
PARAMETERS
hgmnv is the pointer to a Name/Value container.
Name is the name of the name/value pair for which you want to determine the type.
RETURN VALUES
Possible return values are as follows:
GetValueType Return Values
Value Description
SYNTAX
PARAMETERS
hgmnv is the pointer to a Name/Value container.
EXAMPLE
If(GMW_NV_is Root (hgmnv)) {it’s the root} else {it’s a child}
107
Integrating With GoldMine
SYNTAX
Returns the hgmnv of the root for the specified container. If the root’s hgmnv is
specified, the same hgmnv will be returned.
PARAMETERS
hgmnv is the pointer to a Name/Value container.
EXAMPLE
hRootNV = GMN_NV_GetRoot(hgmnv)
SYNTAX
Returns the hgmnv of the parent for the specified container. The function returns
NULL if the specified hgmnv has no parent (is the root).
PARAMETERS
hgmnv is the pointer to a Name/Value container.
EXAMPLE
hParentNV = GMW_NV_GetParent(hgmnv)
SYNTAX
PARAMETERS
hgmnv is the pointer to a Name/Value container.
Name is the name of the name/value pair for which you want to receive the count of
values.
108
Integrating With GoldMine
EXAMPLE
numberOfValues = GMW_NV_GetMultiValueCount(hgmnv, “POP3_Account”)
SYNTAX
PARAMETERS
hgmnv is the pointer to a Name/Value container.
Name is the name of the name/value pair from which you want to receive the child
container.
EXAMPLE
hSubNV = GMW_NV_GetNvValue(hgmnv, “TheNVName”)
When a value contains multiple containers, the GMW_NV_GetMultiNvValue
function is used to retrieve the hgmnv for the child containers.
SYNTAX
PARAMETERS
hgmnv is the pointer to a Name/Value container.
Name is the name of the name/value pair from which you want to receive the child
container.
Position is the nth value you want to retrieve (1 based). If you wanted the tenth
container in the value, then position would be 10.
EXAMPLE
hSubNV = GMW_NV_GtMultiNvValue(hgmnv, “TheNVName”, 10)
109
Integrating With GoldMine
SYNTAX
PARAMETERS
hgmnv is the pointer to a Name/Value container.
Name is the name of the name/value pair for which you want to receive the values
from.
Element is the number of the value to be returned. This is 1 based.
DefaultValue is the default value to return if the element supplied is not found.
EXAMPLE
To return the fifth element:
strFifthElemnt = GMW_NV_GetMultiValue(hgmnv,
“POP3_Account”, 5, “No Account”)
110
Integrating With GoldMine
SYNTAX
PARAMETERS
hgmnv is the pointer to the parent Name/Value container.
Name is the name of the name/value pair into which you want to copy the child
container.
hgmnvValue is the prepared NV container to copy to the parent container.
EXAMPLE
GMW_NV_SetNvValue hgmnv, “TheNVName”, hChildNV
SYNTAX
PARAMETERS
hgmnv is the pointer to the Name/Value container.
Name is the name of the name/value pair into which you want to copy the child
container.
hgmnvValue is the prepared NV container to copy to the parent container.
EXAMPLE
GMW_NV_AppendNvValue hgmnv, “The NVName”, hChildNV
111
Integrating With GoldMine
SYNTAX
PARAMETERS
hgmnv is the pointer to the parent Name/Value container.
Name is the name of the name/value pair in which you want to create the child
container.
EXAMPLE
hChildNv = GMW_NVSetEmptyNvValue(hgmnv, “TheNVName”)
‘now set the values of the child container using the returned HGMNV
When you need to append an empty child container to an NV pair containing
multiple children, use the GMW_NV_AppencdEmptyNvValue function.
SYNTAX
PARAMETERS
hgmnv is the pointer to the parent Name/Value container.
Name is the name of the name/value pair to which you want to append the new
empty child container.
EXAMPLE
hChildNv = GMW_NV_AppendEmptyNvValue(hgmnv, “TheNVName”)
‘now set the values of the child container using the returned HGMNV.
SYNTAX
112
Integrating With GoldMine
PARAMETERS
hgmnv is the pointer to a Name/Value container.
Name is the name of the name/value pair for which you want to receive the count of
values.
Value is the value to be appended to the end of the list of values.
EXAMPLE
To set five (5) values for the POP3_Account value:
For i = 1 To 5
GMW_NV_Append hgmnv, “POP3_Account”, i
Next i
SYNTAX
PARAMETERS
GMW_UserAccess takes one parameter, iOption, which is a value for the types of
rights settings you wish to query.
iOption values
Value Rights
100 Master Rights
101 Access to other user’s calendar
102 Access to other user’s history
103 Access to other user’s sales
104 Access to other user’s reports
105 Access to other user’s merge forms
113
Integrating With GoldMine
Value Rights
106 Access to other user’s filters
107 Access to other user’s groups
108 Access to other user’s links
111 Right to create a record
112 Right to edit a record
113 Right to delete a record
114 Right to change record owner
115 Right to field views
116 Right to schedule automated processes
118 Right to SQL Query
119 Right to NetUpdate
124 Right to build groups
RETURN VALUES
The GMW_UserAccess function returns 1 if the user has the queried rights.
Using GMW_CalAccess, you can query whether the user logged in via the DLL has
rights to read/write a CAL record.
SYNTAX
PARAMETERS
szRecType is the RecType of the record.
szUserID is the UserID of the record.
szNumber1 is the Number1 value of the record.
RETURN VALUES
The GMW_CalAccess function returns 1 if the user has rights to read/write.
Using GMW_HistAccess, you can query if the user logged in via the DLL has rights
to read/write a CONTHIST record.
SYNTAX
114
Integrating With GoldMine
PARAMETERS
szRecType is the RecType of the record.
szUserID is the UserID of the record.
RETURN VALUES
The GMW_HistAccess function returns 1 if the user has rights to read/write.
SYNTAX
PARAMETERS
GMW_GetLicenseInfo takes one parameter pLic, which is a pointer to a client
allocated GMW_LicInfo structure.
RETURN VALUES
The GMW_GetLicenseInfo function returns the following values:
GMW_GetLicenseInfo Return Values
Return Description
0 Failure
1 Success
NOTES
The GMW_LicInfo structure includes the following items:
GMW_GetLicenseInfo Structure
Type/Size Name Description
char / 60 Licensee Licensee name
char / 40 LicNo Master serial number
char / 20 SiteName Undocked site name
long integer LicUsers; Licensed users
long integer SQLUsers; Licensed SQL users
long integer GSSites; License GoldSync sites
long integer isDemo; Is demo install? 1=True
long integer isServerLic; Is primary ('D' or 'E') license? 1=True
long integer isRemoteLic; Is remote (‘U’ or ‘S’) license? 1=True
long integer isUSALicense; Is USA license? 1=True
115
Integrating With GoldMine
EXAMPLE
GMW_LicInfo oLic;
GMW_GetLicenseInfo( &oLic;
SYNTAX
pnv = (GMWnv*)GMW_NV_CreateCls();
C/C++ pnv->Set("RecID", "SOMEVALIDRECID");
GMW_NV_Execute("ReadSchedule", pnv);
116
Integrating With GoldMine
GMW_DS_Range
SYNTAX
117
Integrating With GoldMine
PARAMETERS
The following parameters are required:
szTable specifies the table name (such as “Contact1”) or the table ID.
szTag designates the tag that corresponds to the index file.
szTopLimit specifies the top limit of the range. (Must conform to the index
expression.)
szBotLimit specifies the bottom limit of the range. (Must conform to the index
expression.)
szFields specifies the requested fields and expression to return—see
“GMW_DS_Range Field Selection” on the following page.
The following parameters are optional:
szFilter designates an optional Xbase filter expression.
szFDlm specifies the field delimiter (default: carriage return).
szRDlm specifies the record delimiter (default: line feed).
RETURN VALUES
The GMW_DS_Range function returns the following values:
GMW_DS_Range Return Values
Return Description
0 Failure
1–20 Success (handle)
118
Integrating With GoldMine
The following commands request the first 10 profiles of the current contact record,
followed by a request for the next 50 profiles:
ih1 = GMW_DS_Range( "contsupp","contspfd", sAccNo+"P", sAccNo+"P",
"Contact;ContSupRef;")
r1 = GMW_DS_Fetch( ih1, szBuf, iBufSize, 10 )
r1 = GMW_DS_Fetch( ih1, szBuf, iBufSize, 50 )
r1 = GMW_DS_Close( ih1 )
GMW_DS_Query
SYNTAX
PARAMETERS
szSQL query sends the query for evaluation on the server. The SQL query can join
multiple tables and return any number of fields.
Optional parameter szFilter specifies a Boolean Xbase filter expression to apply to
the data set (even on SQL tables), similar to the DDE SETFILTER command.
Optional parameter szFDlm overrides the return packet’s default field delimiter of
CR (carriage return).
Optional parameter szRDlm overrides the return packet’s default record delimiter of
LF (line feed).
RETURN VALUES
The GMW_DS_Query function returns the following values:
GMW_DS_QueryReturn Values
Return Description
0 Failure
-1 Invalid Query/Timeout
1–20 Success (handle)
GMW_DS_Fetch
SYNTAX
C/C++ long GMW_DS_Fetch( long iHandle, char *szBuf, int iBufSize,
int nGetRecs );
VB Public Declare Function GMW_DS_Fetch Lib "gm6s32.dll" (ByVal iHandle
As Long, ByVal strbuf As String, ByVal iBufSize As Long, ByVal nGetRecs
As Long) As Long
119
Integrating With GoldMine
GMW_DS_Fetch returns a single packet string containing the requested data from all
records processed by the current “fetch” command, as specified by the nGetRecs
parameter. iHandle must be the value returned from GMW_DS_Range() or
GMW_DS_Query().For details about the packet format, see “GMW_DS_Fetch Return
Packet” below.
120
Integrating With GoldMine
number of records to fetch. When GMW_DS_Fetch is then called to retrieve the data
that has been fetched by the first call, the nGetRecs parameter must be 0.
Note: If the return DataStream is too large for the specified buffer size,
GMW_DS_Fetch returns a value of -5. When the buffer in increased to an adequate
size, GMW_DS_Fetch will return the data in a DataStream. This behavior prevents
the dropping of data due to undersized buffers.
GMW_DS_Close
SYNTAX
121
Integrating With GoldMine
122
Integrating With GoldMine
SYNTAX
PARAMETER
The GMW_DB_Open function takes only szTableName, which is the name of the
table to be opened.
RETURN VALUES
The GMW_DB_Open function returns the following values:
GMW_DB_Open Return Values
Return Description
0 Error occurred
>0 Work area handle for table
SYNTAX
PARAMETERS
The GMW_DB_Close function takes only pArea, which is the work area handle of
the file opened by the GMW_DB_Open function.
RETURN VALUES
The GMW_DB_Close function returns the following values:
GMW_DB_Close Return Values
Return Description
0 Error occurred
1 Table properly closed
123
Integrating With GoldMine
SYNTAX
PARAMETER
The GMW_DB_IsSQL function takes only pArea, which is the work area handle of
the file opened by the GMW_DB_Open function.
RETURN VALUES
The GMW_DB_IsSQL function returns the following values in GoldMine 7.0:
GMW_DB_IsSQL Return Values
Return Description
0 Table is not MSSQL
1 Table is MSSQL
Adding a Record
GMW_DB_Append adds an empty record to a GoldMine data file.
SYNTAX
Before using GMW_DB_Append, you must open a data file using the
GMW_DB_Open function. After executing the GMW_DB_Append function, the
record pointer is positioned at the new empty record, and the record is locked and
ready to accept field replacements.
When a CONTACT1 record is appended, GoldMine automatically fills in the new
record with the appropriate ACCOUNTNO and CREATEBY values. For all other
records, you must replace the ACCOUNTNO field with the value from the
CONTACT1 record with which the new record is to be linked. For records that
require remote synchronization initialization, GoldMine will automatically fill in the
value of the RECID field when these records are appended.
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szRecID specifies the size of the character buffer to accept the return value. The
szRecID buffer must be at least 20 characters.
124
Integrating With GoldMine
RETURN VALUE
Xbase: APPEND function returns the record number of the new record, or 0 if the
file could not be locked.
SQL and FireBird: APPEND function returns the RECID of the new record in the
szRecID parameter.
SYNTAX
PARAMETER
The GMW_DB_Delete function takes only pArea, which is the work area handle of
the file opened by the GMW_DB_Open function.
RETURN VALUES
The GMW_DB_Delete function returns the following values:
GMW_DB_Delete Return Values
Return Description
0 Error occurred
1 Record deleted
SYNTAX
C/C++ long GMW_DB_Read(long pArea, char *szField, char *szBuf, int iBufSize);
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szField is the name of the field to read within the table.
szBuf is the buffer in which the function will return the results.
iBufSize specifies the size of the buffer.
125
Integrating With GoldMine
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
SzRecID is a character string that accepts the return value of RecNo (Xbase) or RecID
(SQL).
RETURN VALUE
Xbase: Returns the current record number
SQL: Returns the current RecID
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szField specifies the name of the field to be replaced.
szData specifies the data to be placed in the field.
iAddTo indicates if the data is to be appended to the existing data. A value of 1 will
append the data. A value of 0 will overwrite the data.
126
Integrating With GoldMine
RETURN VALUES
The GMW_DB_Replace function returns the following values:
GMW_DB_Replace Return Values
Return Description
0 Error occurred
1 Field was successfully replaced
Unlocking a Record
GMW_DB_Unlock unlocks a record previously locked by a call to either
GMW_DB_Append or GMW_DB_Replace.
SYNTAX
PARAMETER
The GMW_DB_Unlock function takes only pArea, which is the work area handle of
the file opened by the GMW_DB_Open function.
RETURN VALUES
The GMW_DB_Unlock function returns the following values:
GMW_DB_Unlock Return Values
Return Description
0 Error occurred
1 Success
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szFilterExpr is the valid Xbase expression. To remove the filter, send an empty string
as the second parameter.
127
Integrating With GoldMine
RETURN VALUES
The GMW_DB_Filter function returns the following values:
GMW_DB_Filter Return Values
Return Description
0 Error occurred
1 Success
SYNTAX
C/C++ long GMW_DB_Range(long pArea, char *szMin, char *szMax, char *szTag);
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szMin specifies the minimum or lower value of the range.
szMax specifies maximum or upper value of the range.
szTag is the index tag name.
RETURN VALUES
The GMW_DB_Range function returns the following values:
GMW_DB_Range Return Values
Return Description
0 Error occurred
1 Success
SYNTAX
128
Integrating With GoldMine
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szExpr is the valid Xbase expression. For a record to be “found” this expression must
result as TRUE.
szRecID is the buffer where the return value is stored. The return value will be a
record number under Xbase or a RecID under SQL. You may pass NULL as the third
parameter if you do not want the RecNo/RecID.
RETURN VALUES
The GMW_DB_Search function returns the following values:
GMW_DB_Search Return Values
Return Description
0 No match found
>0 Xbase: RecNo of the matching record; SQL: RecID of the matching record
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szParam is the value you will seek. This value must match the format of the index
expression for the currently active index.
\RETURN VALUES
The GMW_DB_Seek function returns the following values:
GMW_DB_Seek Return Values
Return Description
0 Error occurred
1 Exact match found. Cursor moved to record.
2 Exact match not found. Cursor placed at closest matching record.
3 EOF (end of file)
4 BOF (beginning of file)
129
Integrating With GoldMine
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
For a list of index names, see “Database Structures” on page 377.
szTag is the name of the index tag to activate on the table.
RETURN VALUES
The GMW_DB_SetOrder function returns the following values:
GMW_DB_SetOrder Return Values
Return Description
0 Error occurred
1 Index successfully activated
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szCommand is the command to execute. Each of these commands has an
independent function equivalent that is the preferred method to use. This function
remains as a legacy to its DDE counterpart.
szParam is the scope or value for the command.
GMW_DB_Move Commands and Function Equivalents
Command Parameter Function Equivalents
TOP Not required GMW_DB_Top
BOTTOM Not required GMW_DB_Bottom
130
Integrating With GoldMine
RETURN VALUES
The GMW_DB_Move function returns the following values:
GMW_DB_Move Return Values
Return Description
0 Error occurred
1 Exact match found. Cursor moved to record or index-activated.
2 Exact match not found. Cursor placed at closes matching record.
3 Cursor at end-of-file (EOF)
4 Cursor at beginning-of-file (BOF)
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
szRecNo specifies where the cursor should be placed, and is either the Record
number for Xbase or the RecID for SQL
RETURN VALUES
The GMW_DB_Goto function returns the following values:
GMW_DB_Goto Return Values
Return Description
0 Error occurred
1 Exact match found. Cursor moved to record or Index activated.
2 Exact match NOT found. Cursor placed at closest matching record.
3 Cursor at end-of-file (EOF)
4 Cursor at beginning-of-file (BOF)
131
Integrating With GoldMine
SYNTAX
PARAMETER
The GMW_DB_Top function takes only pArea, which is the work area handle of the
file opened by the GMW_DB_Open function.
RETURN VALUES
The GMW_DB_Top function returns the following values:
GMW_DB_TopReturn Values
Return Description
0 Error occurred
1 Cursor moved to top of file
SYNTAX
PARAMETERS
pArea is the work area handle of the file opened by the GMW_DB_Open function.
nSkip specifies the number records to skip. This value can be positive to move
forward in the table or negative to move backwards.
RETURN VALUES
The GMW_DB_Skip function returns the following values:
GMW_DB_Skip Return Values
Return Description
0 Error occurred
1 Cursor successfully moved
3 Cursor at end-of-file (EOF)
4 Cursor at beginning-of-file (BOF)
132
Integrating With GoldMine
SYNTAX
PARAMETER
The GMW_DB_Bottom function takes only pArea, which is the work area handle of
the file opened by the GMW_DB_Open function.
RETURN VALUES
The GMW_DB_Bottom function returns the following values:
GMW_DB_Bottom Return Values
Return Description
0 Error occurred
1 Cursor positioned on the last record in the table
Seeking a Record
GMW_DB_QuickSeek wraps several other database functions to provide a quick and
easy way to seek a record in the database.
SYNTAX
PARAMETERS
szTableName is the name of the table to be opened.
szIndex is the index to use for the table.
szSeekValue is the seek expression to use.
szRecID is returned by the function. This is the RecID of the record found.
RETURN VALUES
The GMW_DB_QuickSeek function returns the following values:
GMW_DB_QuickSeek Return Values
Return Description
-2 Invalid Index
-1 Invalid table
0 Failure
1 Success
133
Integrating With GoldMine
SYNTAX
PARAMETERS
szTableName is the name of the table to be opened.
szRecID is the RecID of the record from which to read.
szField is the Field name to return.
szValue is the value returned by the function.
iLen is the length of the returned data.
RETURN VALUES
The GMW_DB_QuickRead function returns the following values:
GMW_DB_QuickRead Return Values
Return Description
-4 Invalid Fieldname
-3 RecID not found
-2 Invalid RecID
-1 Invalid table
0 Failure
1 Success
SYNTAX
134
Integrating With GoldMine
PARAMETERS
szTableName is the name of the table to be opened.
szRecID is the RecID of the record to be updated.
szField is the Field name to replace.
szValue is the value to store in the field.
iAddTo indicates if the value data is to be appended (1) or replaced (0=default).
RETURN VALUES
The GMW_DB_QuickReplace function returns the following values:
GMW_DB_QuickReplace Return Values
Return Description
-4 Invalid Fieldname
-3 RecID not found
-2 Invalid RecID
-1 Invalid table
0 Failure
1 Success
PARAMETERS
szTable specifies the table name (such as “Contact1”) or the table ID.
135
Integrating With GoldMine
szRecID specifies the RecID of the updated record: the correct RecID must be passed,
and the RecID value must be exactly 15 characters long.
szField specifies the name of the field that has changed. This parameter is only
relevant when the Action parameter is U. szField is ignored when Action is N or D.
szAction should be N when a new record has been appended, D when a record has
been deleted, or U when a field in a record has been updated.
RETURN VALUES
The GMW_UpdateSyncLog function returns the following values:
GMW_UpdateSyncLog Return Values
Return Description
0 Error
1 New TLog entry created
2 New TLog entry updated
4 Field TLog entry created
8 Field TLog entry updated
16 Deleted record TLog entry created
32 New TLog Entry removed
EXAMPLE
char szTable[10] = "CONTACT1";
char szField[12] = "KEY2";
char szRecID[20] = "\0";
char szAction = 'U';
GMW_NewRecID(szRecID,"JON" ); GMW_UpdateSyncLog( szTable, szRecID,
szField, szAction );
SYNTAX
PARAMETERS
szFile specifies the import file name—see below for the import file structure.
IDeleteWhenDone specifies to delete the import file when the process has completed.
SzStatus buffer used to monitor the status of the process. Optional, can be NULL. If
passed, the szStatus buffer must be at least 10 characters long.
136
Integrating With GoldMine
RETURN VALUES
The GMW_ReadImpTLog function returns the following values:
GMW_ReadImpTLog Return Values
Return Description
0 Failure
>0 Success, total number of imported TLog records
NOTES
GMW_LoadAPI or GMW_LoadBDE must be called before calling
GMW_ReadImpTLog for the first time. GMW_ReadImpTLog is executed in a thread,
so multiple calls can be made. Your application can determine when the imported
process completes by setting the iDeleteWhenDone parameter to 1, and noting when
the import file is deleted. The TLog import must have the structure shown in the
following table.
TLog Import Structure
Field Name Type Length
Table ID char 10
RecID char 15
Field ID char 10
Action ID char 1
EXAMPLE
char szImpFile[80] = "d:\\GoldMine\\tlogimp.dbf";
char szStatus[20] = "\0";
int iDeleteWhenDone = 1;
int nTotRead = GMW_ReadImpTLog(szImpFile, iDeleteWhenDone, szStatus
);
SYNTAX
PARAMETERS
szRecID specifies the application allocated buffer to contain the new RecID. The
buffer must be at least 16 characters long.
szUser specifies the GoldMine user name.
RETURN VALUE
pointer to szRecIDBuf
137
Integrating With GoldMine
NOTES
GMW_NewRecID returns a new RecID in the szRecIDBuf. GMW_NewRecID can be
called without first calling GMW_LoadAPI or GMW_LoadBDE.
EXAMPLE
char szRecID[20] = "\0";
char szUser[10] = "JON";
GMW_NewRecID( szRecID, szUser );
SYNTAX
PARAMETERS
When the szStamp string parameter is exactly 17 characters long, formatted as
Date:Time in form of CCYYMMDD:HH:MM:SS, the return string in szOutBuf is in
TLog timestamp format, exactly seven characters long. When the szStamp parameter
is seven characters long formatted as a TLog timestamp, the return string in
szOutBuf is formatted as CCYYMMDD:HH:MM:SS.
RETURN VALUES
The GMW_SyncStamp function returns the following values:
GMW_SyncStamp Return Values
Return Description
0 Failure
1 Success
NOTES
An empty return string indicates an error.
EXAMPLE
The following examples convert February 1, 1998, at 7:01pm to a TLog time stamp
format, then back to a date and time format:
Char szOut[20] = "\0"
GMW_SyncStamp("19980201:19:01:30", szOut); // returns "+#G><N2"
GMW_SyncStamp("+#G><N2", szOut ); // returns "19980201:19:01:30"
138
Integrating With GoldMine
139
Integrating With GoldMine
EXAMPLE
xmlout = GMAPI.ExecuteCommand(xmlIn)
<GMAPI call="FunctionName">
<data name="Parameter1">Parameter Value</data>
<data name="Parameter2">Parameter Value 2</data>
</GMAPI>
PARAMETERS
The LoadAPI function takes seven parameters.
User: Specifies the GoldMine user name (case insensitive).
You may set this parameter to the value of *DDE_LOGIN_CREDENTIALS* to use
login credentials returned for the user logged into a running copy of GoldMine
through DDE or COM.
140
Integrating With GoldMine
The status code will always give a description as to the cause of any generated
errors. The possible return codes are as follows.
LoadAPI Return Values
Return Description
1 API loaded successfully
0 API already loaded
-1 API failed to load
-2 Cannot find license file
-3 Cannot load license file
-4 Cannot validate the license file username/password
-5 Invalid GoldDir
-6 Invalid CommonDir
-7 Failed to allocate the needed TLS slot
-8 General Failure
-9 No access to specified contact set for this user
141
Integrating With GoldMine
PARAMETERS
The LoadBDE function takes seven parameters.
User: Specifies the GoldMine user name (case insensitive).
You may set this parameter to the value of *DDE_LOGIN_CREDENTIALS* to use
login credentials returned for the user logged into a running copy of GoldMine
through DDE or COM.
Password: Specifies the user’s password (case insensitive).
You may set this to the return string from the GetLoginCredentials DDE or COM
command if the User parameter is set to *DDE_Login_Credentials*. The credential
string is only valid for 30 seconds.
SysDir: Specifies the location of the LICENSE.DBF.
GoldDir: Specifies the location of CAL.DBF.
ComDir: Specifies the location of CONTACT1.DBF.
SQLUser: The login name for the SQL Server, if applicable.
SQLPassword: The password for the SQL Server, if applicable.
142
Integrating With GoldMine
The status code will always give a description as to the cause of any generated
errors. The possible return codes are as follows.
LoadBDE Return Values
Return Description
1 BDE loaded successfully
0 BDE already loaded
-1 BDE failed to load
-2 Cannot find license file
-3 Cannot load license file
-4 Cannot validate the license file username/password
-5 Invalid GoldDir
-6 Invalid CommonDir
-7 Failed to allocate the needed TLS slot
-8 General Failure
-9 No access to specified contact set for this user
PARAMETERS
The Login function takes five parameters.
User: Specifies the GoldMine user name (case insensitive).
You may set this parameter to the value of *DDE_LOGIN_CREDENTIALS* to use
login credentials returned for the user logged into a running copy of GoldMine
through DDE or COM.
Password: Specifies the user’s password (case insensitive).
You may set this to the return string from the GetLoginCredentials DDE or COM
command if the User parameter is set to *DDE_Login_Credentials*. The credential
string is only valid for 30 seconds.
143
Integrating With GoldMine
Logging Out
To log out a user when multiple users are logged in, use the Logout function. This
function will free the license seat previously used by the Login function. Be sure to
call this function for each session that has been opened.
SYNTAX
PARAMETERS
SessionID is the integer value returned by the Login function.
RETURNS
The function will return a code attribute of “1” if the specified SessionID was valid.
The returned XML will look like the following:
<GMAPI SessionID="2" call="Logout">
<status code="1">Logout succeeded for the supplied session.</status>
</GMAPI>
The actual SessionID will be the value that was returned by the LoadAPI call.
144
Integrating With GoldMine
The actual SessionID will be the value that was returned by the LoadBDE call.
145
Integrating With GoldMine
Each time there needs to be an additional node for the Members node, simply repeat
the Members node with the required data. This applies to any business logic
function that requires more than one data value for a node, or more than one nested
node.
Input XML:
<GMAPI call="WriteContact" SessionID="1">
<data name="Contact">Joe Smith</data>
<data name="Company">Joes Window Washing</data>
<data name="phone1">3106548963</data>
</GMAPI>
Returned XML:
<GMAPI SessionID="1" call="WriteContact">
<status code="1">Success</status>
<data name="Return">
<data name="AccountNo">A4100552319*T_S{3Del</data>
<data name="COMPANY">Joes Window Washing</data>
<data name="CONTACT">Joe Smith</data>
<data name="PHONE1">3106548963</data>
<data name="RecID">AP7Q62B&*AK=3\T</data>
</data>
</GMAPI>
146
Integrating With GoldMine
147
Integrating With GoldMine
Either the DS_Range function or the DS_Query function must be called first to
request the data. These functions return the integer handle which must be passed to
the DS_Fetch and DS_Close functions.
You must use either DS_Range or DS_Query—you cannot use both. The DS_Range
and DS_Query functions execute equally fast on SQL databases. DS_Range executes
much faster on Xbase tables than does DS_Query.
DS_Range
SYNTAX
</GMAPI>
PARAMETERS
The following parameters are required:
Table specifies the table name (such as “Contact1”) or the table ID.
Tag designates the tag that corresponds to the index file.
TopLimit specifies the top limit of the range. (Must conform to the index expression.)
BotLimit (or BottomLimit) specifies the bottom limit of the range. (Must conform to
the index expression.)
Fields specifies the requested fields and expression to return—see “DS_Range Field
Selection” on the following page.
The following parameters are optional:
Filter designates an optional Xbase filter expression.
RETURN VALUES
The XML returned by DS_Range will look like the following:
<GMAPI SessionID="2" call="DS_Range">
<status code="1">1</status>
</GMAPI>
148
Integrating With GoldMine
The text of the code attribute is used as the “Area” or “Handle” value for DS_Fetch.
The DS_Range function returns the following values:
GMW_DS_Range Return Values
Return Description
0 Failure
1–20 Success (handle)
DS_Query
SYNTAX
PARAMETERS
SQL query sends the query for evaluation on the server. The SQL query can join
multiple tables and return any number of fields.
Optional parameter Filter specifies a Boolean Xbase filter expression to apply to the
data set (even on SQL tables), similar to the DDE SETFILTER command.
RETURN VALUES
The DS_Query function returns the following values:
DS_QueryReturn Values
Return Description
0 Failure
-1 Invalid Query/Timeout
1–20 Success (handle)
DS_Fetch
DS_Fetch returns a single packet string containing the requested data from all records
processed by the current “fetch” command.
149
Integrating With GoldMine
SYNTAX
XML <GMAPI call=”DS_Fetch” SessionID=”3”>
<data name=”Area”>Value returned from Query or
Range</data>
<data name=”RecordCount”>50</data>
<data name=”Raw”>1</data>
</GMAPI>
PARAMETERS:
RecordCount (or RecCount) specifies the number of records to return.
Area must be the value returned from DS_Range() or DS_Query().
OPTIONAL PARAMETERS:
FldDmt (or FieldDelimiter) specifies the field delimiter (default: carriage return). Omit
this data node completely to use the default value.
RowDmt (or RowDelimiter) specifies the record delimiter (default: line feed). Omit
this data node completely to use the default value.
Raw indicates the format the data should be returned as. The default (“0”) puts the
data into XML format. Setting Raw to “1” returns the data stream in the old return
packet format, as described below.
For details about the packet format, see “DS_Fetch Return Packet” below.
Returns:
<GMAPI SessionID="1" call="DS_Query"><status
code="1">1</status></GMAPI>
150
Integrating With GoldMine
The Header node contains child nodes for each field included in the SQL query,
describing the fields’ properties. The CountData node’s text corresponds with the
old fetch return packet’s header data:
The first digit can be 0, 3, or 4:
0 indicates that more records are available, which could be fetched with another
DS_Fetch call
3 indicates the end-of-file (EOF)
4 indicates the beginning-of-file (BOF)
151
Integrating With GoldMine
Number following the dash indicates the total number of data records contained in
the packet.
The Rows node contains a child node for each data record returned by the query.
DS_Close
DS_Close must be called when the operation is complete. Unclosed data streams will
leak memory and leave the database connections needlessly open. Passing an Area
(or Handle) of 0 closes all open DataStream objects.
152
Integrating With GoldMine
SYNTAX
153
Integrating With GoldMine
154
Integrating With GoldMine
SYNTAX
PARAMETER
The DB_Open function takes only Table(or File), which is the name of the table to be
opened.
RETURN VALUES
The XML returned by DB_Open for a successful call will look like the following:
<GMAPI SessionID="2" call="DB_Open">
<status code="1">76007040</status>
</GMAPI>
The code attribute will be 1 on success and the text of the attribute is the workarea to
be used for subsequent low-level calls. If the call is unsuccessful, the code will be 0
and the text will indicate an error.
SYNTAX
PARAMETERS
The DB_Close function takes only Area, which is the work area handle of the file
opened by the DB_Open function.
RETURN VALUES
DB_Close returns the following XML on success:
<GMAPI SessionID="2" call="DB_Close">
<status code="1">Success</status>
</GMAPI>
155
Integrating With GoldMine
SYNTAX
PARAMETER
The DB_IsSQL function takes only Area, which is the work area handle of the file
opened by the DB_Open function.
RETURN VALUES
The DB_IsSQL function returns the following values:
<GMAPI SessionID="3" call="DB_IsSQL">
<status code="0">The open file is xBase.</status>
</GMAPI>
DB_IsSQL Code Attribute Values
Code Description
0 The open file is Other
1 The open file is MSSQL
Adding a Record
DB_Append adds an empty record to a GoldMine data file.
SYNTAX
Before using DB_Append, you must open a data file using the DB_Open function.
After executing the DB_Append function, the record pointer is positioned at the new
empty record, and the record is locked and ready to accept field replacements.
When a CONTACT1 record is appended, GoldMine automatically fills in the new
record with the appropriate ACCOUNTNO and CREATEBY values. For all other
records, you must replace the ACCOUNTNO field with the value from the
CONTACT1 record with which the new record is to be linked. The GoldMine XML
API will automatically fill in the value of the RECID field.
PARAMETERS
Area is the work area handle of the file opened by the DB_Open function.
156
Integrating With GoldMine
RETURN VALUE
Xbase: APPEND function returns the record number of the new record as the code
attribute, or 0 if the file could not be locked. The text of the code attribute is also the
record number in xBase, Record ID in SQL and FireBird.
<GMAPI SessionID="3" call="DB_Append">
<status code="64">64</status>
</GMAPI>
SQL: APPEND function returns the RECID of the new record in the text of the code
attribute. The code will be 1 or 0 indicating success or failure.
SYNTAX
PARAMETER
The DB_Delete function takes only Area, which is the work area handle of the file
opened by the DB_Open function.
RETURN VALUES
The DB_Delete function returns the following XML:
<GMAPI SessionID="4" call="DB_Delete">
<status code="1">Success</status>
</GMAPI>
157
Integrating With GoldMine
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the GMW_DB_Open function.
Field is the name of the field to read within the table.
RETURN VALUE
The XML returned for DB_Read using the sample XML above is as follows:
<GMAPI SessionID="5" call="DB_Read">
<status code="1">FrontRange Solutions, Inc.</status>
</GMAPI>
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the DB_Open function.
RETURN VALUE
Xbase: Returns the current record number
SQL: Returns the current RecID
The returned XML will look like the following:
<GMAPI SessionID="7" call="DB_RecNo">
<status code="1">BDNHWD5#0PA5]WV</status>
</GMAPI>
158
Integrating With GoldMine
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the DB_Open function.
Field specifies the name of the field to be replaced.
NewValue specifies the data to be placed in the field.
Append indicates if the data is to be appended to the existing data. A value of 1 will
append the data. A value of 0 will overwrite the data.
RETURN VALUES
The DB_Replace function returns the following XML:
<GMAPI SessionID="9" call="DB_Replace">
<status code="1">Success</status>
</GMAPI>
Unlocking a Record
DB_Unlock unlocks a record previously locked by a call to either DB_Append or
DB_Replace.
SYNTAX
PARAMETER
The DB_Unlock function takes only Area, which is the work area handle of the file
opened by the DB_Open function.
159
Integrating With GoldMine
RETURN VALUES
The DB_Unlock function returns the following XML:
<GMAPI SessionID="3" call="DB_Unlock">
<status code="1">Success</status>
</GMAPI>
SYNTAX
NOTE
The Filter value above is XML encoded. Passing the value contact1->contact=”Paul
Redstone” through an XML Parser would handle the XML encoding automatically.
PARAMETERS
Area is the work area handle of the file opened by the GMW_DB_Open function.
Filter (or FilterExpr, Expr, Expression) is the valid Xbase expression. To remove the
filter, send an empty string as the second parameter.
RETURN VALUES
The DB_Filter function returns the following XML:
<GMAPI SessionID="1" call="DB_Filter">
<status code="1">Success</status>
</GMAPI>
160
Integrating With GoldMine
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the GMW_DB_Open function.
Min specifies the minimum or lower value of the range.
Max specifies maximum or upper value of the range.
Tag is the index tag name.
RETURN VALUES
The DB_Range function returns the following XML:
<GMAPI SessionID="1" call="DB_Range">
<status code="1">Success</status>
</GMAPI>
SYNTAX
161
Integrating With GoldMine
PARAMETERS
Area is the work area handle of the file opened by the GMW_DB_Open function.
Expr (or Expression) is the valid Xbase expression. For a record to be “found” this
expression must result as TRUE. Be sure to XML encode this, since the “>” in an
Xbase expression is an XML entity.
RETURN VALUES
The DB_Search function returns the following XML:
<GMAPI SessionID="1" call="DB_Search">
<status code="1">23</status>
</GMAPI>
The text of the code attribute will be the record number for dBase databases, and the
RecID for SQL databases.
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the GMW_DB_Open function.
Param is the value you will seek. This value must match the format of the index
expression for the currently active index.
RETURN VALUES
The DB_Seek function returns the following XML:
<GMAPI SessionID="1" call="DB_Seek">
<status code="1">Success- Exact match found.</status>
</GMAPI>
162
Integrating With GoldMine
0 Error occurred
1 Exact match found. Cursor moved to record.
2 Exact match not found. Cursor placed at closest matching record.
3 EOF (end of file)
4 BOF (beginning of file)
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the DB_Open function. Tag is the
name of the index tag to activate on the table. For a list of index names, see
“Database Structures” on page 377.
RETURN VALUES
The DB_SetOrder function returns the following XML:
<GMAPI SessionID="1" call="DB_SetOrder">
<status code="1">Success</status>
</GMAPI>
DB_SetOrder Code Attribute Values
Code Description
0 Error occurred
1 Index successfully activated
SYNTAX
163
Integrating With GoldMine
PARAMETERS
Area is the work area handle of the file opened by the GMW_DB_Open function.
Command is the command to execute. Each of these commands has an independent
function equivalent that is the preferred method to use. This function remains as a
legacy to its DDE counterpart.
Parameter is the scope or value for the command.
DB_Move Commands and Function Equivalents
Command Parameter Function Equivalents
TOP Not required DB_Top
BOTTOM Not required DB_Bottom
RETURN VALUES
The DB_Move function returns the following XML:
<GMAPI SessionID="1" call="DB_Move">
<status code="1">Exact match found. Cursor moved to record or index
activated.</status>
</GMAPI>
DB_Move Code Attribute Values
Code Description
0 Error occurred
1 Exact match found. Cursor moved to record or index-activated.
2 Exact match not found. Cursor placed at closest matching record.
3 Cursor at end-of-file (EOF)
4 Cursor at beginning-of-file (BOF)
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the GMW_DB_Open function.
164
Integrating With GoldMine
RecNo (or RecordNumber) specifies where the cursor should be placed, and is either
the Record number for Xbase or the RecID for SQL. The RecID works for Xbase as
well.
165
Integrating With GoldMine
RETURN VALUES
The DB_Goto function returns the following XML:
<GMAPI SessionID="1" call="DB_Goto">
<status code="1">Exact match found. Cursor moved to record or index
activated.</status>
</GMAPI>
SYNTAX
PARAMETER
The DB_Top function takes only Area, which is the work area handle of the file
opened by the DB_Open function.
RETURN VALUES
The DB_Top function returns the following XML:
<GMAPI SessionID="1" call="DB_Top">
<status code="1">Success</status>
</GMAPI>
166
Integrating With GoldMine
SYNTAX
PARAMETERS
Area is the work area handle of the file opened by the DB_Open function.
Skip specifies the number records to skip. This value can be positive to move
forward in the table or negative to move backwards.
RETURN VALUES
The DB_Skip function returns the following XML:
<GMAPI SessionID="1" call="DB_Skip">
<status code="1">Success</status>
</GMAPI>
SYNTAX
PARAMETER
The DB_Bottom function takes only Area, which is the work area handle of the file
opened by the DB_Open function.
RETURN VALUES
The DB_Bottom function returns the following XML:
<GMAPI SessionID="1" call="DB_Bottom">
<status code="1">Success</status>
</GMAPI>
167
Integrating With GoldMine
Seeking a Record
DB_QuickSeek wraps several other database functions to provide a quick and easy
way to seek a record in the database.
SYNTAX
PARAMETERS
Table is the name of the table to be opened.
Index is the index to use for the table.
SeekValue is the seek expression to use.
RETURN VALUES
The DB_QuickSeek function returns the following XML:
<GMAPI SessionID="1" call="DB_QuickSeek">
<status code="1">9Z2RME8(X%(!3\T</status>
</GMAPI>
168
Integrating With GoldMine
SYNTAX
PARAMETERS
Table is the name of the table to be opened.
RecID (or RecordID) is the RecID of the record from which to read.
Field (or FieldName) is the Field name to return.
RETURN VALUES
The DB_QuickRead function returns the following XML:
SYNTAX
PARAMETERS
Table is the name of the table to be opened.
RecID (or RecordID) is the RecID of the record to be updated.
Field (or FieldName) is the Field name to replace.
Value (or Data, NewValue) is the value to store in the field.
169
Integrating With GoldMine
AddTo (or Append) indicates if the value data is to be appended (1) or replaced
(0=default).
RETURN VALUES
The DB_QuickReplace function returns the following XML:
<GMAPI SessionID="1" call="DB_QuickReplace">
<status code="1">Success</status>
</GMAPI>
DB_QuickReplace Code Attribute Values
Return Description
-4 Invalid Fieldname
-3 RecID not found
-2 Invalid RecID
-1 Invalid table
0 Failure
1 Success
SYNTAX
RETURN VALUES
The ReadSchedule call returns the following XML:
<GMAPI call="ReadSchedule" SessionID="XXX">
<status code="1">Success</status>
<data name="Return">
<data name="ACCOUNTNO">A5040658567& _:+]Mat</data>
<data name="ACTVCODE"/>
<data name="COLORCODE">0</data>
<data name="CONTACT">Matthew W & Kathleen Blacklock</data>
<data name="DURATION"> 30</data>
<data name="LINK">1</data>
<data name="LOPRECID"> UAQI6O((X$]]WV</data>
<data name="NOTIFY">0</data>
<data name="ONDATE">20060530</data>
<data name="ONTIME"> 7:00am </data>
<data name="PRIVATE">0</data>
<data name="RECID">BUAQI6O!* C8]WV</data>
<data name="RECTYPE">C</data>
<data name="REF"/>
<data name="RSVP">0</data>
<data name="UPDATERELATED">0</data>
<data name="USERID">GUY</data>
</data>
</GMAPI>
170
Integrating With GoldMine
PARAMETERS
Table specifies the table name (such as “Contact1”) or the table ID.
171
Integrating With GoldMine
RecID specifies the RecID of the updated record: the correct RecID must be passed,
and the RecID value must be exactly 15 characters long.
Field specifies the name of the field that has changed. This parameter is only relevant
when the Action parameter is U. Field is ignored when Action is N or D.
Action should be N when a new record has been appended, D when a record has
been deleted, or U when a field in a record has been updated.
RETURN VALUES
The UpdateSyncLog function returns the following XML:
<GMAPI SessionID="1" call="UpdateSyncLog">
<status code="4">Field TLog entry created.</status>
</GMAPI>
SYNTAX
PARAMETERS
File specifies the import file name—see below for the import file structure.
Delete specifies to delete the import file when the process has completed.
RETURN VALUES
ReadImpTLog function returns the following values in the code attribute:
ReadImpTLog Code Attribute Values
Code Description
0 Failure
172
Integrating With GoldMine
Code Description
1 Success -- Text is total number of imported TLog records
NOTES
LoadAPI or LoadBDE must be called before calling ReadImpTLog for the first time.
Your application can determine when the imported process completes by setting the
Delete parameter to 1, and noting when the import file is deleted. The TLog import
must have the structure shown in the following table.
TLog Import Structure
Field Name Type Length
Table ID char 10
RecID char 15
Field ID char 10
Action ID char 1
SYNTAX
PARAMETERS
User specifies the GoldMine user name.
RETURN VALUE
<GMAPI SessionID="1" call="NewRecID">
<status code="1">AQN8HK0 I9& =$R</status>
</GMAPI>
NOTES
The resulting Recid is XML encoded because it contains an XML entity. Reading the
text of the code attribute via an XML Parser would return the correctly XML
unencoded RecID.
SYNTAX
173
Integrating With GoldMine
PARAMETERS
When the Stamp parameter is exactly 17 characters long, formatted as Date:Time in
form of CCYYMMDD:HH:MM:SS, the return string in the code attribute’s text is in
TLog timestamp format, exactly seven characters long. When the Stamp parameter is
seven characters long formatted as a TLog timestamp, the return string in the code
attribute’s text is formatted as CCYYMMDD:HH:MM:SS.
RETURN VALUES
The SyncStamp function returns the following example XML:
<GMAPI SessionID="1" call="SyncStamp">
<status code="1">5V1QM50</status>
</GMAPI>
NOTES
An empty return string indicates an error.
Getting Started
The examples in this section will use functions and syntax from Microsoft XML 4.0
and Visual Basic 6.0. Include a reference to Microsoft XML, v. 4.0 in your
development project. To create a document reference, use the following code:
Dim doc As DOMDocument40
Set doc = New DOMDocument40
The XML document is now ready to be composed.
174
Integrating With GoldMine
xmlIn = "<GMAPI/>"
Dim doc As DOMDocument40
Set doc = New DOMDocument40
doc.loadXML xmlIn
Setting Attributes
The attributes of an element define a specific setting or provide additional
information to an element. Attributes appear in an element’s start tag and are in a
name/value pair format. The GoldMine XML API typically expects two attributes
for the root element: call and sessionid.
To set an attribute, use the SetAttribute method in the documentElement object. The
following code assumes the elRoot object defined above.
Referencing an Attribute
The call attribute for the GMAPI root element will likely need to be changed many
times in the course of your application. A reference to this attribute can be obtained
by calling the following code:
Be sure to set all references to Nothing (or Null) before exiting your application!
Set elRoot = Nothing
Set doc = Nothing
Set att = Nothing
175
Integrating With GoldMine
‘Set the attribute with the sParamName value being the name of
the ‘parameter
tempEL.setAttribute "name", sParamName
End Sub
The above subroutine can now be called to set many parameters for a function. The
example below assumes the document, root element and attribute objects created in
the previous section.
att.Text = "DB_Replace"
176
Integrating With GoldMine
End Sub
177
Integrating With GoldMine
End Function
docReturned.loadXML xmlReturned
Set elRootReturned = docReturned.documentElement
Set elReturnData =
elRootReturned.selectSingleNode("data[@name='Return']")
If Not elReturnData Is Nothing Then
Set elFieldValue =
elReturnData.selectSingleNode("data[@name='CONTACT']")
If Not elFieldValue Is Nothing Then _
txtContactName = elFieldValue.Text
End If
178
Integrating With GoldMine
179
Integrating With GoldMine
Since these commands are an exact duplicate to the GoldMine XML API
commands, they will not be documented in this chapter. For information on
using the commands accepted in this class, please see Chapter 4, Working with
the XML API.
2. GoldMine.UI – This class has methods and events that replace all current DDE
functionality and to control the GoldMine user interface.
3. GoldMine.RecObj – This class has events for notifying client applications of
Record object changes.
Getting Started
To access the GoldMine COM Server, add a reference to the GoldMine 6.7 Type
Library to your project. Objects for each of the classes can now be created.
Executing Commands
The GoldMine.UI and GoldMine.GoldMineData classes only have one exposed
method:
ExecuteCommand([in]BSTR xmlIn, [out, retval] BSTR* xmlOut)
To use this method, build your XML document using a DOM parser, such as
MSXML, then pass the resulting document to the ExecuteCommand method.
strOut = GMUI.ExecuteCommand(txtXMLIn.Text)
If your application is developed in VB, C#, VB.NET, or Delphi the call will have the
same format as above.
StringVar = GMUI.ExecuteCommand(xmlIN)
180
Integrating With GoldMine
Logging In to GoldMine
Using the GoldMine COM Server requires that GoldMine is running on the
computer the client application is also running on. If GoldMine is not running, it
will be launched the first time a call is made to the GoldMine COM Server.
However, this will only bring GoldMine to the login screen. The GoldMine.UI and
GoldMine.GoldMineData classes both have a command to handle this, Login.
Following is example code for calling the Login command:
GMObj.ExecuteCommand("<GMAPI call=""Login""><data
name=""User"">MASTER</data><data
name=""Pass"">ACCESS</data></GMAPI>")
If the Login attempt was successful, the COM server will return:
<GMAPI call="Login">
<status code="1">Succeeded.</status>
</GMAPI>
GoldMine.UI Class
The UI class of the GoldMine COM Server provides identical functionality to the
legacy DDE Server. If you are familiar with using the DDE commands, porting to
the COM Server will be natural. There is additional functionality in the COM Server
that allows control of the GoldMine user-interface with commands such as
launching menu items, being notified when a window is being launched, and
manipulating controls.
181
Integrating With GoldMine
This suite of functions is usually used for database applications that need varied
access to GoldMine data.
The Append function is used to add an empty record to a GoldMine data file. Before
using Append, you must open a data file using the Open function. After executing
the Append function, the record pointer is positioned at the new empty record, and
the record is locked and ready to accept field replacements.
When a CONTACT1 record is appended, GoldMine automatically propagates the
new record with the appropriate ACCOUNTNO and CREATEBY values. For all
other records, you must replace the ACCOUNTNO field with the value from the
CONTACT1 record with which the new record is to be linked. For records that
require remote synchronization initialization, GoldMine will automatically
propagate the value of the RECID field when these records are appended.
Parameters
The Append function accepts one parameter, the work area handle of the file to
Append. The work area handle is returned by the Open file when the file is opened.
Return Value
Xbase: The Append function returns the record number of the new record, or 0 if the
file could not be locked.
SQL: The Append function returns the record ID.
RETURNED XML
<GMAPI call="Append">
<status code="1">72</status>
</GMAPI>
The Close function is used to release a previously OPENed file when processing is
complete. When access is complete, a file must be CLOSEd to release memory used
by GoldMine to maintain database work areas.
182
Integrating With GoldMine
PARAMETERS
The Close function accepts one parameter, Area—the work area handle of the file to
close. The Open file returns the work area handle when the file is opened.
RETURN VALUE
The Close value returns 1 if the function was able to successfully close the work area,
0 if an invalid work area handle was passed.
RETURNED XML
<GMAPI call="Close"><status code="1">Success</status></GMAPI>
The Delete function deletes the current record in the specified work area. The record
pointer is not advanced to the next record.
PARAMETERS
The Delete function takes one parameter, Area—the work area value obtained from
the Open function.
RETURNED XML
<GMAPI call="Delete">
<status code="1">Success</status>
</GMAPI>
The Filter function limits access to data in a GoldMine database by creating a subset
of records based on expression criteria.
PARAMETERS
The Filter function takes two parameters.
Area: the work area handle of the file that you want to read. The Open function
provides this value when the data file is opened.
183
Integrating With GoldMine
The IsSQL function returns the table type (Xbase or SQL) that is open in a work area.
Using this command, you can determine the most appropriate method to retrieve
information when working with DataStream. For example, when your routine starts,
you can open Contact1 and Cal, issue an IsSQL command to determine the GoldDir
and CommonDir database types, and then close both work areas. You can then send
the appropriate DataStream calls.
PARAMETERS
The IsSQL function takes work area as the only parameter, Area.
RETURN VALUES
IsSQL returns 1 for an SQL database table, or 0 for an Xbase file.
RETURNED XML
<GMAPI call="IsSql">
<status code="0">The open file is xBase.</status>
</GMAPI>
184
Integrating With GoldMine
The Move function will position the record pointer to a particular record in a data
file. Before using Move, you must open a data file using the Open function.
PARAMETERS
The Move function requires either two or three parameters.
Area: the work area handle of the file whose record pointer you want to position.
The Open function provides this value when the data file is opened.
Command: the name of the Move subfunction that you want to perform.
Parameter: Depending on the subfunction, a third parameter can be required.
The following table lists the Move subfunctions and the requirements for the third
parameter:
Valid Move Subfunctions
Subfunction Description 3rd Parameter
TOP Move to first logical record Not required
BOTTOM Move to last logical record Not required
SKIP Skip records Optional, records to skip
GOTO Go to a specific record Record number (Xbase), Record ID (SQL)
SEEK Seek a specific record by key Search key value
SETORDER Select an index Index name
Top Positions the record pointer at the first logical record according to the current index
order. For example, if the data file open in the selected work area is CONTACT1.DBF,
and the index order is set to Company, a call to TOP will result in the record pointer
being positioned at a record with a company name, such as AAA Cleaners.
Bottom Positions the record pointer at the last logical record according to the current index
order. For example, if the data file open in the selected work area is CONTACT1.DBF,
and the index order is set to Company, a call to BOTTOM will result in the record
pointer being positioned at a record with a company name, such as Z-best Bakery.
Skip Moves the record pointer record by record. If SKIP is called without the third
parameter, it will move the record pointer to the next logical record according to the
current index order. If SKIP is called with a string numeric as the third parameter, the
record pointer will be moved forward by the indicated number if the value is positive, or
backward if the value is negative. Negative numbers must be passed in quotation
marks, for example “-1”.
Goto Positions the record pointer at the record number (Xbase) or record ID (SQL) specified
by a string numeric passed as the third parameter.
Seek Attempts to locate a record in the data file with an index key that matches the string
passed as the third parameter. Partial key searches are allowed; GoldMine will
position the record pointer at the record with the key that most closely matches the
passed value.
185
Integrating With GoldMine
Setorder Selects an active index for ordering and SEEKing the data file. See “Database
Structures” on page 377 for the appropriate values and collating sequence for each
data file index.
If an invalid index is selected for the data file, none of the MOVE subfunctions will
operate properly.
RETURN VALUE
The Move function can return several values.
Move Return Values
Return Description
0 Error occurred
1 Record pointer successfully moved, or index selected
2 Exact match not found, pointer positioned at closest match
3 Record pointer positioned at end-of-file (EOF)
4 Record pointer positioned at beginning-of-file (BOF)
RETURNED XML
<GMAPI call="MOVE">
<status code="1">1</status>
</GMAPI>
The Open function is used to open a GoldMine data file for processing by another
application. This function must be called before calling any GoldMine.UI data
functions that work with an individual data file. It is not necessary to use this
function when calling the RecordObj function or user-interface control functions.
186
Integrating With GoldMine
PARAMETERS
The Open function takes one parameter, Filename. The following values are valid for
this parameter:
Open Valid Parameters
File Description
CAL Calendar activities file
CONTACT1 Primary contact information file
CONTACT2 Primary contact information file
CONTGRPS Groups file
CONTHIST History records file
CONTSUPP Supplementary records file
INFOMINE InfoCenter file
LOOKUP Lookup file
MAILBOX E-mail Center mailbox file
OPMGR Opportunity Manager file
PERPHONE Personal Rolodex file
RESOURCE Resources file
SPFILES Contact files directory
RETURN VALUE
The Open function returns an integer value representing the handle to the file’s work
area. This value is required for all subsequent access to the file. If the file could not
be opened, or an invalid parameter is passed, the function will
return 0.
RETURNED XML
<GMAPI call="Open"><status code="1">87732928</status></GMAPI>
The Range function activates the index in a table and sets a range of values to limit
the scope of data that GoldMine will search.
PARAMETERS
The Range function requires four parameters.
187
Integrating With GoldMine
Area: the work area handle of the file that you want to read. The Open function
provides this value when the data file is opened.
Min: the minimum value of the range.
Max: the maximum value of the range.
Tag: the tag that corresponds to the index file. For details about tags, see “Database
Structures” on page 377.
RETURNED XML
<GMAPI call="Range">
<status code="1">Success</status>
</GMAPI>
<GMAPI call="Query">
<data name="Area">87732928</data>
Syntax
<data name="SQL">select recid from contact1 where state=”MI”</data>
</GMAPI>
The Query function limits the set of records that can be accessed to the result set
from the specified SQL query. After calling the Query command, issue a MOVE
command to move the record pointer into the result set from the Query (by calling
TOP for example).
PARAMETERS
Area: the area value returned by the Open command.
SQL: the SQL query to send to the server.
RETURNED XML
<GMAPI call="Query"><status code="1">Success</status></GMAPI>
The Read function is used to query a data file for the value of a field. Before using
Read, you must open a data file using the Open function. In addition, you will
probably want to position the record pointer to the record you want to query by
using the Move function.
PARAMETERS
The Read function requires two parameters.
Area: The first parameter is the work area handle of the file that you want to read.
The Open function provides this value when the data file is opened.
188
Integrating With GoldMine
Field: The second parameter is the name of the field in the data file whose value you
want to query. You will normally pass only a single field name, such as CONTACT
as the second parameter. However, if you pass a field expression, such as
“COMPANY + CONTACT” GoldMine will attempt to evaluate the expression and
return the value of the expression.
RETURN VALUE
The Read function returns a character string containing the value in the specified
field, or the value of the specified expression. An invalid work area handle, an
invalid field being passed, or an expression that GoldMine could not evaluate can
cause errors.
RETURNED XML
<GMAPI call="Read">
<status code="1">Client Prospect</status>
</GMAPI>
PARAMETERS
The RecNo function accepts one parameter, Area—the work area handle of the file.
The Open function returns the workarea.
RETURN VALUE
The RecNo function returns the current record number position, 0 if an invalid work
area handle was passed.
RETURNED XML
<GMAPI call="Recno">
<status code="1">21</status>
</GMAPI>
189
Integrating With GoldMine
The Replace function is used to change the value in a particular field in one
GoldMine data file. Before using Replace, you must open a data file using the Open
function. In addition, you will probably want to position the record pointer to the
record you want to change either by using the Move function, or by adding a new
record with the Append function.
After executing the Replace function, GoldMine will update the specified field with
the new value, and update the appropriate remote synchronization data structures
to indicate that the field was changed.
In a network environment, GoldMine automatically locks the record before
performing the replacement. The record is not automatically unlocked, allowing for
fast multiple field replacements. The record is automatically unlocked when a Close,
Move, or Unlock command is issued on the work area.
PARAMETERS
The Replace function requires three parameters and has an optional fourth
parameter.
Area: The first parameter is the work area handle of the file in which you want to
perform the replacement. The Open function provides this value when the data file
is opened.
Field: The second parameter is the name of the field to be replaced. See “Database
Structures” on page 377 for information on the name of fields in each GoldMine data
files. If you attempt to replace a field that does not exist in the file open in the
specified work area, the Replace function will fail.
NewValue: The third parameter is the value to replace. The replace value must be a
string value. If the replacement field is a date or numeric field, GoldMine will
convert the string data to the appropriate data type prior to performing the
replacement.
Append: The fourth parameter will add data instead of replacing data. Using this
parameter, you can insert large amount of text into a notes field. To append instead
of replace incoming data from the third parameter, pass 1 as the fourth parameter.
You can set up a loop to feed notes in 256-byte segments to override the 256-byte
limit for inbound DDE requests.
RETURN VALUE
If the file was replaced, the Replace function returns 1.
<GMAPI call="Replace"><status code="1">Success</status></GMAPI>
If the field could not be replaced, 0 is returned. The failure can be caused under any
of the following conditions:
• Invalid parameter, such as an invalid work area handle.
• Invalid field name.
• Record already locked by another user.
190
Integrating With GoldMine
The Search function is used to perform a sequential search on a file. Unlike Move,
Search scans the table, one record at a time, looking for a record that satisfies the
search condition. The search condition can be any Xbase expression that GoldMine
understands, but is usually an expression that tests the value of one or more fields in
the file. When a match is found, the record pointer is located at the matching record.
Search starts with the record that immediately follows the current record (the next
logical record according to the selected index order) and continues until a match is
found or the end of file is encountered. Because of this, Search can be called
repeatedly to return a list of records that satisfy the search condition.
PARAMETERS
The Search function takes three parameters.
Area: the work area handle of the file you want to search. The Open function
provides this value when the data file is opened.
Expression: the search expression, such as “CITY=‘Los Angeles’”
RETURN VALUE
The Search function can return several values.
Search Return Values
Return Description
0 Error occurred or match could not be found
>0 Match found; return value indicated current physical record number (Xbase)
or record ID (SQL)
An error can be returned if an invalid work area handle is passed to the function, or
if an invalid search condition is passed.
RETURNED XML
<GMAPI call="search">
<status code="1">1</status>
</GMAPI>
Unlocking a Record
<GMAPI call="Unlock">
Syntax <data name="Area">87675752</data>
</GMAPI>
The Unlock function unlocks a record previously locked by a call to either Append
191
Integrating With GoldMine
or Replace. GoldMine does not specifically release a lock on a record until you call
Unlock, allowing you to perform multiple field replacements quickly. Before using
Unlock, you must open a data file using the Open function.
After calling Unlock, GoldMine will also update the remote synchronization data
structures to indicate the date and time that the record was modified.
PARAMETERS
The Unlock function accepts one parameter, Area—the work area handle of the file
to close. The work area handle is returned by the Open file when the file is opened.
RETURN VALUE
The Unlock function returns 1 if the record was unlocked, or 0 if an invalid work
area handle was passed to the function.
RETURNED XML
<GMAPI call="Unlock">
<status code="1">Success</status>
</GMAPI>
192
Integrating With GoldMine
PARAMETERS
The RecordObj function requires either one or two parameters.
Command: the name of the RecordObj subfunction that you want to perform.
Argument: Depending on the subfunction, a second parameter can be required. The
following table lists the RecordObj subfunctions and the requirements of the second
parameter.
Valid RecordObj Functions
Subfunction Description Argument
SETOBJECT Create or select contact record Optional object pointer
TOP Move to first logical record Not required
BOTTOM Move to last logical record Not required
SKIP Skip records Optional, recs to skip
SEEK Seek a specific record by key Search key value
SETORDER Select an index Index tag number
193
Integrating With GoldMine
Top Positions the record pointer at the first logical record according to the current
index order. For example, if the contact record index order is set to Company,
a call to Top will result in the record pointer being positioned at a record with a
company name such as “AAA Cleaners.” GoldMine will also update the contact
record to display the new record.
Bottom Positions the record pointer at the last logical record according to the current
index order. For example, if the contact record index order is set to Company,
a call to Bottom will result in the record pointer being positioned at a record with
a company name such as “Z-best Bakery.” GoldMine will also display the new
record.
194
Integrating With GoldMine
Skip The Skip subfunction moves the record pointer on a record-by-record basis.
If Skip is called without the second parameter, it will move the record pointer to
the next logical record according to the current index order.
If Skip is called with a string numeric as the second parameter, the record
pointer will be moved forward by the indicated number of records if the value is
positive, or backwards if the value is negative. GoldMine will also update the
display to show the new record.
The Skip subfunction is sensitive to any filter or group that can be active on the
contact record in GoldMine. For example, if the user applies a filter to the
contact record in GoldMine, the Skip subfunction will skip over any records that
do not match the filter expression.
Goto The Goto subfunction positions the record pointer at the record number
specified by a string numeric passed as the second parameter. Additionally,
accepts a third optional parameter, SetPrimary, indicating if only primary
contacts should be searched (1) or (0 - default) to include additional contacts in
the search scope.
<GMAPI call="RecordObj">
<data name="Command">skip</data>
<data name="Argument">3</data>
<data name=”SetPrimary”>1</data>
</GMAPI>
Seek Attempts to locate a record in the data file with an index key that matches the
string passed as the second parameter. Partial key searches are allowed, and
GoldMine will position the record pointer at the record with the key that most
closely matches the passed value. GoldMine will update the display to show the
new record.
Setorder Selects an active index for ordering and SEEKing the contact database. Only
the twelve CONTACT1 indexes can be used for this subfunction. See
“Database Structures” on page 377 for the appropriate values and collating
sequence for each data file’s indexes.
Getorder Returns the active index being used to sort the contact records. See “Database
Structures” on page 377 for the appropriate values and collating sequence for
each data file’s indexes.
Settitle Changes both the text in the title bar of the contact record’s window and the text
displayed below a minimized contact record. For example, an application that
merges contact records within a document can modify the contact record title to
indicate the number of records that have been merged. Any text that is passed
as the second parameter will be used as the new title’s text.
Closewindow Closes the contact record when processing is complete. Issuing this call is
equivalent to selecting Close from the contact record’s system menu.
195
Integrating With GoldMine
Setrecord Changes the behavior of the Skip, Top, and Bottom subfunctions to allow
ancillary contact information (such as additional contacts) to be queried using
the RecordObj function. Normally, GoldMine assumes the CONTACT1 data file
to be the parent data file, and when the Skip, Top, or Bottom subfunction is
called, the record pointer is repositioned in this data file. When accessing
information in GoldMine tabs, however, the Skip, Top, and Bottom subfunctions
must be able to reposition the record pointer in the data file that stores these
items (CONTSUPP).
The SetRecord subfunction accepts the name of the data structure being
queried as the second parameter. Valid data structure names are listed in the
following table.
The first parameter is the name of the RecordObj subfunction that you want to
perform. When Top is called, GoldMine will position the record pointer in the
supplementary data file so that the first record containing the selected
information is the current record. For example, if SetRecord is used to select
CONTACTS, Top will position the record pointer on the first additional contact
record for the current contact. The record pointer in the primary information data
file (CONTACT1) will not be moved, so the name of the current company will
remain the same. Bottom behaves in a similar manner.
Skip will position the record pointer in the supplementary file on the next
record of the selected type. For example, if SetRecord is used to select
CONTACTS, Skip will position the record pointer in the supplementary file on
the next additional contact record for the current contact. The record pointer in
the primary information data file (CONTACT1) will not be moved, unless the
record pointer in the supplementary file was already positioned at the last
record of the selected type; then GoldMine will reposition the record pointer in
the primary information data file (CONTACT1) to the next contact record and
reset the record pointer in the supplementary file to the first supplemental
record of the selected type. Macro expressions are also sensitive to the setting
of the SetRecord subfunction.
196
Integrating With GoldMine
RETURN VALUE
All RecordObj subfunctions return 1 if the function was completed successfully, or 0
if an internal error occurred.
RETURNED XML
<GMAPI call="RecordObj">
<status code="1">Skip Success</status>
</GMAPI>
RETURNED XML
<GMAPI call="GetActivatedPlugIns">
<status code="1">Success</status>
<data name="PlugInList">
<data name="PlugIn">3007__FrontRangeCTestControl</data>
<data
name="PlugIn">3002__FrontRangeOutlookWebAccess</data>
<data
name="PlugIn">3250__FrontRangeMovieViewer10__LaunchMovieViewer10</dat
a>
<data
name="PlugIn">3251__FrontRangeMovieViewer10__ConfigureMovieViewer10</
data>
<data name="PlugIn">3001__FrontRangeTestCalendar</data>
<data name="PlugIn">3003__FrontRangeHelpAbout</data>
<data name="PlugIn">3008__GamesKittenGame</data>
<data name="PlugIn">3013__GMAIL</data>
<data name="PlugIn">3005__GoogleGoogleMaps</data>
197
Integrating With GoldMine
<data name="PlugIn">3000__JCSFlashandGMViaVBNET</data>
<data name="PlugIn">3009__JCSOfficeDocument</data>
<data
name="PlugIn">3004__SolutionSellingSolutionSelling</data>
</data>
</GMAPI>
Or
<GMAPI call="RunPlugIn">3013</GMAPI>
Or
<GMAPI call="RunPlugIn">
Syntax
<data name=”PlugIn”>3013__GMAIL</data>
</GMAPI>
Or
<GMAPI call="RunPlugIn">
<data name=”PlugIn”>3013</data>
</GMAPI>
The RunPlugIn function attempts to start the designated plug-in. For more
information about GoldMine Plug-ins, see the Working with GoldMine Plug-ins
chapter.
RETURNED XML
<GMAPI call="RunPlugIn">
<status code="1">The plug-in call was successful.</status>
</GMAPI>
Or
<GMAPI call="RunPlugIn">
<status code="0"> The Plug-in ID is invalid</status>
</GMAPI>
198
Integrating With GoldMine
not necessary to prompt the integration user for login information if GoldMine is
running. The login credentials received are only valid for 30 seconds, so do not store
them and attempt to use them at a later time. The string returned by this command
should be used as the password to the appropriate login function, where the
username is “*DDE_LOGIN_CREDENTIALS*”.
RETURNED XML
<GMAPI call="GetLoginCredentials">
<status code="1">KEVIN
01C4D24F7051B9B04F882C36294F1F4AB4E4D20FCF3C1682</status>
</GMAPI>
The GetActiveOppty function is used to retrieve the RecID of the currently selected
Opportunity in the Opportunity Manager.
RETURN VALUE
The GetActiveOppty function returns the record ID of the currently selected
opportunity. If no opportunity is available, an empty string is returned.
RETURNED XML
No opportunity or project selected in GoldMine:
<GMAPI call="GetActiveOppty">
<status code="1"></status>
</GMAPI>
PARAMETERS
The CalComplete function takes up to seven parameters.
199
Integrating With GoldMine
RETURN VALUE
The CalComplete function returns the record number (Xbase) or record ID (SQL) of
the new history record created.
RETURNED XML
<GMAPI call="CalComplete">
<status code="1">1980</status>
</GMAPI>
Use the PopCalHistItem function to display the edit window for calendar or history
items, including email. When you pass it a valid cal table or conthist recID, the
correct edit window will open.
The Calendar Item edit window is a modal dialog: the return value will not be sent
until the user closes the edit window.
For history items, the record object will align to the owner of the history
automatically. This will not occur for calendar items.
GENERAL MESSAGES
<GMAPI call="PopCalHistItem"><status code="-33001">
PopCalItem has failed because the passed record could not be found.
</status></GMAPI>
<GMAPI call="PopCalHistItem"><status code="-33002">
PopCalItem opens a calendar or contact history record for editing.
Parameters
RecID: the record id of the cal or conthist table entry.
</status></GMAPI>
200
Integrating With GoldMine
RETURN VALUES
The CallerID function is used to inform the GoldMine user that an incoming call has
been identified by Automatic Number Identification (ANI) equipment attached to
the telephone system. By using CallerID, GoldMine can perform a lookup on the
contact database, and attempt to locate a contact record with a telephone number
that matches the telephone number extracted by the ANI device.
With the CallerID function, GoldMine can automatically display the contact record of
the caller. A dialog box is displayed, allowing the user to select an action. A CallerID
function parameter is used to specify the message in the dialog box.
PARAMETERS
The CallerID function accepts five parameters:
Phone: the telephone number of the caller as captured by the ANI device. The
calling application is responsible for formatting the telephone number that appears
in the Phone1 field in GoldMine.
Description: the optional message to be displayed in the dialog box in GoldMine.
All: Indicates for GoldMine to search all of the phone fields on the contact record
(except FAX). Set to 1 to search all phone fields, 0 to indicate to search only Phone1.
UPhone: Indicates for GoldMine to search the UPhone fields in contact2. This
parameter is ignored if the All parameter is set to 0.
201
Integrating With GoldMine
DisplayDialog: specifies whether the dialog box is displayed. This parameter is the
sum of the required options. For example, to display the caller’s contact record in the
current window if the record is found, or to display the contact listing if the caller’s
phone number is not found, specify 6 (2+4) as the <display dialog> parameter. The
following table lists valid parameter values.
CallerID Parameters
Value Description
0 Dialog box is displayed (default when third parameter is not passed)
1 Dialog box is not displayed, and contact record is displayed in a new contact record
2 Dialog box is not displayed, and contact record is displayed in the current contact record
4 Contact Listing is displayed when GoldMine cannot find the contact’s telephone number.
To activate this option, add this value to the third parameter value.
8 Restores input focus to the window that had input focus just before CALLERID is
called—used by applications that control the entire interface.
RETURN VALUES
RETURNED XML
<GMAPI call="CallerID">
<status code="1">Passed caller was found</status>
</GMAPI>
Running a Counter
<GMAPI call="F2Counter">
<data name="Name">My counter</data>
<data name="Inc">1</data>
Syntax
<data name="Start">0</data>
<data name="Action">0</data>
</GMAPI>
The F2Counter function returns a sequence of consecutive numbers each time the
expression is evaluated. The DDE equivalent to this function was called “Counter”.
PARAMETERS
The counter name must be unique, and can be a maximum of 10 characters. Each
evaluation of the Counter function increments the counter by the Inc value.
202
Integrating With GoldMine
The Start and Action parameters are optional. When Action is 1, the start value resets
the counter. When Action is 2, the counter is deleted. F2Counter stores the count
value between GoldMine sessions, and it is shared by all GoldMine users.
GoldMine can track an unlimited number of uniquely named counters. The counter
values are stored in the LOOKUP table.
RETURN VALUE
The F2Counter function returns a number incremented by Inc.
EXAMPLE
The following sets up the counter:
<GMAPI call="F2Counter">
<data name="Name">Num Iterations</data>
<data name="Inc">1</data>
<data name="Start">0</data>
<data name="Action">0</data>
</GMAPI>
Returns:
<GMAPI call="F2Counter">
<status code="1">0</status>
</GMAPI>
Returns:
<GMAPI call="F2Counter">
<status code="1">1</status>
</GMAPI>
203
Integrating With GoldMine
<GMAPI call=”DataStream”>
<data name=”Command”>Range</data>
<data name=”Table”>Contact1</data>
<data name=”Tag”>CONTNAME</data>
Range <data name=”BotLimit”>A</data>
<data name=”TopLimit”>ZZ</data>
<data name=”Fields”>contact;company</data>
<data name=”Filter”>EXPRESSION</data><! –NOT REQUIRED- >
</GMAPI>
<GMAPI call=”DataStream”>
<data name=”Command”>Query</data>
Query <data name=”SQL”>select recid from contact1</data>
<data name=”Filter”>EXPRESSION</data><! –NOT REQUIRED- >
</GMAPI>
<GMAPI call=”DataStream”>
<data name=”Command”>Fetch</data>
<data name=”Area”>1</data>
<data name=”FetchCount”>55</data>
Fetch <data name=”Raw”>0</data><! –NOT REQUIRED- >
<data name=”FieldDelimiter”>|</data><! –NOT REQUIRED- >
<data name=”RowDelimiter”>\-/</data><! –NOT REQUIRED- >
</GMAPI>
<GMAPI call=”DataStream”>
<data name=”Command”>Close</data>
Close <data name=”Area”>1</data>
</GMAPI>
DataStream returns the data of requested records from any GoldMine table using the
most efficient method possible. The caller can specify the fields and expressions to
return, as well as the range of records to return. A filter can optionally be applied to
the data set.
The DataStream method allows for many useful applications. One example would be
to publish the contents of GoldMine data on the Internet by using XSL templates
with the data returned by DataStream. Web pages can be created to display GoldMine
data requested by a visitor. Based on the visitor’s selections, a company could
dynamically present a variety of HTML pages, such as:
• Addresses of product dealers in a particular city
• Financial numbers stored in Contact2
• Seating availability of upcoming conferences
With a fast Internet connection and a strong SQL server, the GoldMine client could
simultaneously respond to dozens of requests.
204
Integrating With GoldMine
RECORD SELECTION
The DataStream command consists of four subcommands. Each subcommand takes
different parameters.
The “range” or “query” subcommands must be called first to request the data. The
“range” and “query” subcommands return an integer handle, which must be passed
to the “fetch” and “close” subcommands. You must use either “range” or “query”—
not both.
205
Integrating With GoldMine
Returns:
<GMAPI SessionID="1" call="DS_Query"><status
code="1">1</status></GMAPI>
206
Integrating With GoldMine
<data name="KEY1">Partner</data>
</data>
</data>
</data>
</GMAPI>
The Header node contains child nodes for each field included in the SQL query,
describing the fields’ properties. The CountData node’s text corresponds with the
old fetch return packet’s header data:
The first digit can be 0, 3, or 4:
0 indicates that more records are available, which could be fetched with another
DS_Fetch call
3 indicates the end-of-file (EOF)
4 indicates the beginning-of-file (BOF)
Number following the dash indicates the total number of data records contained in
the packet.
The Rows node contains a child node for each data record returned by the query.
RETURN PACKET
The “fetch” command returns a single packet string containing the data from all
requested records. The packet includes a header record, followed by one record for
each record evaluated by “fetch.” Within each record in the packet, the fields are
separated by a Field Delimiter, the carriage return character by default (13 or 0x0D).
The records in the packet are separated by the Record Delimiter, the line feed
character by default (10 or 0x0A). These delimiters are convenient when the
requested data does not contain notes from blob fields. Otherwise, you must
override the default delimiters by passing other delimiter values to the “fetch”
command. The characters 1 and 2 would probably make good delimiters for packets
with notes.
An example of a packet of data:
3000-0004
Boston|23
London|393
Los Angeles|633
New York|29
The packet header record consists of two sections. The first byte can be 0, 3
or 4. Zero indicates that more records are available, which could be fetched with
another “fetch” command. A value of 3 indicates the end-of-file (EOF), and 4
indicates the beginning-of-file (BOF). The number following the dash indicates the
total number of data records contained in the packet.
Packets should be designed to be 8K to 32K. DataStream takes about as much time to
read three records as it does to read 30. For best performance, adjust the number to
records requested by the “fetch” command to return packets of 8K
to 32K.
207
Integrating With GoldMine
PERFORMANCE
DataStream is the fastest way to read data from GoldMine tables. Used correctly, the
GoldMine DataStream will return the data faster than most development
environments would directly. DataStream offers the following advantages:
1. DataStream issues a single, efficient SQL query or Xbase seek to retrieve the
records from the back-end database to the local client. On SQL databases,
requests of a few hundred records could be sent from the server to the client
with a single network transaction, thereby minimizing network traffic.
2. All fields and expressions are parsed initially by the “range” and “query”
commands, then quickly evaluated against each record in the “fetch”
command. Other lower level GoldMine.UI methods (and development
environments) require that each field be parsed and evaluated each time the
field’s data is read. This can save a significant amount of time when reading
hundreds or thousands of records.
3. Only three calls are required to read all the data. Using traditional record-by-
record querying would require one call for each field of each record (reading
10 fields from 50 records would require 500 calls).
The “range” and “query” commands execute equally fast on SQL databases. The
“range” command executes much faster on Xbase tables than the “query” command.
For details about setting up and working with the GoldMine Web Import Gateway, see
“Capturing Web Data” in Maintaining GoldMine.
The Expr function is similar to the Read function in that it attempts to evaluate an
Xbase expression and return the result. The Expr function, however, does not require
you to open a specific data file using the Open function. The expression passed to the
Expr function is evaluated against the current operating state of GoldMine (usually,
208
Integrating With GoldMine
the currently displayed record), rather than the state of a specific work area. For this
reason, you should be aware that differences between the return values could exist
for the same expression passed to Read and Expr.
PARAMETERS
The Expr function takes one parameter, Expression—the Xbase expression to be
evaluated. GoldMine supports a subset of the Xbase dialect, so there is substantial
flexibility in the application of this function.
When referencing field names within an expression, you should always use an alias;
otherwise, GoldMine assumes CONTACT1 to be the default alias.
RETURN VALUE
The Expr function returns a character string containing the value of the specified
expression. If an error occurs, or the expression could not be evaluated, the Expr
function will return a null string.
The following XML:
<GMAPI call="Expr">
<data name="Expression">&CityStateZip</data>
</GMAPI>
Returns:
<GMAPI call="Expr">
<status code="1">Colorado Springs, CO 80920</status>
</GMAPI>
PARAMETERS
The FormAddFields function takes two parameters.
FormNo: the number of the form.
FieldList: a string that lists fields, macros, and expressions; each item in the string is
separated by a semicolon (;). GoldMine parses the string, checks for duplication,
assigns names to the fields, and then stores the items.
209
Integrating With GoldMine
The FormClearFields function opens an existing form profile and deletes all
associated fields.
PARAMETERS
The FormClearFields function takes one parameter, FormNo—the number of the
form.
RETURN VALUE
The FormClearFields function returns 1 if the profile is open, or 0 if an error occurs.
PARAMETERS
The FormCloseForm function does not accept any parameters.
The FormCreateFile function creates an Xbase (DBF) file with all registered fields.
Any active filter or group that applies to the contact record is taken into account.
FormCreateFile can be used to export data via the COM Server.
PARAMETERS
The FormCreateFile function takes four parameters.
FormNo: the number of the form.
File: the name of the .DBF file to be created.
MergeCode: the merge code. If any merge code value(s) are included in the function,
only records with the matching merge code(s) will be included. To include multiple
merge codes, place a space between each individual merge code. If the MergeCode
parameter is empty, all records are included.
WhichRec: indicates which records are to be exported. The WhichRec value is the
sum of values for each available listed below.
WhichRec Values
Value Description
1 Primary
2 Secondary
210
Integrating With GoldMine
Value Description
4 All records
8 Forward to last
16 Return control to the calling program immediately after export has started
RETURN VALUE
The FORMCREATEFILE function returns the total number of records in the output
.DBF file.
The FormGetFieldName function returns the field name for an expression, a macro,
or a field.
PARAMETERS
The FormGetFieldName function takes two parameters.
FormNo: the number of the form.
Field: the name of the field, macro, or expression to be associated with the file name.
RETURN VALUE
The FormNewFormNo function returns a new, unique FormNo value that can be
used to register fields not attached to a GoldMine form.
PARAMETERS
The FormQueryCreate function takes one optional parameter, Flags.
211
Integrating With GoldMine
RETURN VALUE
The FormQueryCreate function returns the number of records created while an
export is in progress, or -1 when the record export process is completed.
FormPrintedDoc
<GMAPI call=”FormPrintedDoc”>
Syntax <data name=”RecordID”> 9NDJRJN(EQ[)JW:</data>
</GMAPI
PARAMETERS
RecordID: the RecID of the pending literature fulfillment request.
PARAMETERS
AccNo: the account number of the contact record to which the new history record
will be linked.
Rectype: the record type to create. The following values are available:
212
Integrating With GoldMine
RETURN VALUE
The InsHistory function returns the record number (Xbase) or record ID (SQL) of the
new history record if the function was completed successfully. The function returns
0 if a new record could not be appended to the data file.
RETURNED XML
<GMAPI call="InsHist">
<status code="1">1982</status>
</GMAPI>
213
Integrating With GoldMine
PARAMETERS
RecNo: the record number of the link record to be updated. If a new link record is to
be created, pass 0 as the first parameter.
File: the fully qualified path and filename of the file to link. Keep in mind that a
valid association must exist for the file’s extension if GoldMine is to automatically
launch the file’s application.
Desc: the document title.
User: the optional document owner. If this field is not passed, the document owner
defaults to the name of the currently logged GoldMine user.
Notes: optional notes for the linked document record in the Links tab.
Sync: defines the remote synchronization status for the linked document from the
values shown in the following table.
Sync Valid Values
Value Action
-1 Uses the GoldMine default as defined by Allow new documents to sync by default in
the Sync tab of the Preferences window.
0 Does not synchronize the newly linked document.
1 Allows the newly linked document to synchronize.
RETURN VALUE
The LinkDoc function returns the new record number (Xbase) or record ID (SQL) if
the function was completed successfully. The function returns any empty string if a
new record could not be appended to the data file, or an existing record could not be
locked for update.
RETURNED XML
<GMAPI call="LinkDoc">
214
Integrating With GoldMine
<status code="1">482</status>
</GMAPI>
PARAMETERS
The MsgBox function accepts two parameters.
MsgBox: the message to display within the dialog box.
Style: the optional style of the message box. This value is the sum of the following
options:
MsgBox Style Values
Value Meaning
0 Display OK button only
1 Display OK and Cancel buttons
2 Display Abort, Retry, and Ignore buttons
3 Display Yes, No, and Cancel buttons
4 Display Yes and No buttons
5 Display Retry and Cancel buttons
16 Display Stop icon
32 Display Question Mark icon
48 Display Exclamation Mark icon
64 Display Information icon
128 First button is default
256 Second button is default
512 Third button is default
RETURN VALUE
The MsgBox function returns the following values:
MsgBox Return Values
Return Description
1 OK button selected
2 Cancel button selected
3 Abort button selected
4 Retry button selected
215
Integrating With GoldMine
Return Description
5 Ignore button selected
6 Yes button selected
7 No button selected
RETURNED XML
<GMAPI call="MsgBox">
<status code="1">6</status>
</GMAPI>
The NewForm function adds a merge template record into the Merge Forms window
in GoldMine. This function’s DDE counterpart is used primarily by the document
merge link installation macro; however, the function can also be used to add
additional merge templates from a user-written application.
PARAMETERS
The NewForm function takes up to six parameters; the first three parameters are
required, and the last three parameters are optional.
AppType: the type of document to which the new form record will point. This value
must be a valid Application Identifier, such as Word.Document.6, that corresponds
to an entry in the Registration Database.
Template: the fully qualified path and filename of the template file.
Title: the title of the document as it should appear in the Merge Forms browse
window.
Macro: the name of an optional DDE function to be called after the template is
loaded by the linked application. If this parameter is not specified, the default
function is MAINMENU. This parameter must be passed in DDE call format.
FormType: the optional type of template. If this parameter is not specified, the
template type is assumed to be Document. GoldMine accepts the following values
for this parameter:
Document Types
Type Description
0 Document
216
Integrating With GoldMine
Type Description
1 Spreadsheet
2 Other
Flags: a three-character field corresponding to the values of the Link To Doc, Save
History and Allow Hot Link options on the Form Setup dialog box. To set (check) one
of these options, 1 is passed; to reset (uncheck), 0 is passed.
217
Integrating With GoldMine
Flag Values
Position Description
0 Link To Doc check box
1 Save History check box
2 Allow Hot Link check box
RETURN VALUE
The NewForm function returns a form number.
PARAMETERS
The PlayMacro function takes two parameters that identify the macro and assign a
wait state.
Macro: The first parameter identifies the macro. Either the number for the currently
logged user or a valid macro filename can be used to identify a macro.
For details about creating a macro from the GoldMine toolbar, see “Customizing the
GoldMine Toolbar” in the online Help.
218
Integrating With GoldMine
RETURN VALUE
The PlayMacro function returns an integer value based on the wait parameter; that
is, GoldMine availability to process a task in addition to the currently running
macro. If the wait parameter is 0 (GoldMine does not wait for the macro to finish to
process another task), the PlayMacro function will always return 1. If the wait
parameter is 1 (GoldMine will wait for the current macro to finish before processing
another macro or task), the PlayMacro function will return either 0 or 1 under the
following conditions:
PlayMacro Return Values
Return Description
0 Error occurred during macro playback
1 Macro played successfully
You can also play a macro from the command line (DOS prompt). Executing a macro from the
command line can be useful in running functions at night, such as indexing, running an Automated
Process, or synchronizing with remote sites with a transfer set created via macro. You can either
identify a macro by an identification number, like GMW4 /m:801, or by file name like GMW4 /m:c:
\index.801. If necessary, the command line statement can start GoldMine and then, once started,
run the macro.
If running the Plus! Pack with Windows, you can run a macro from the System Agent by placing a
command line switch for GoldMine in the Program field of the Schedule a New Program dialog box
that will run a macro. For example, to log in John with his username and password, then run John’s
first macro, place the following macro in the System Agent:
Where GMW5/ starts Goldmine, u:john/ is login user John, p:pswd/ enters the password
password, and m:800 runs first macro.
The SendPage function allows you to create and send a message to the pager of a
GoldMine user. The function consists of the following components:
219
Integrating With GoldMine
Message can consist of any text message that you create with this function to send to
a pager; most pages can accept messages of
70–100 characters.
From includes the sender’s name as an optional “signature.”
To identifies an optional GoldMine user who will receive the pager message.
Information about the pager must be entered in the Edit|Preferences|Pager tab, such
as ID code or PIN number, telephone number of the pager, and maximum message
size in characters that the pager can accept.
RETURN VALUE
The SendPage function can return one of two values.
SendPage Return Values
Return Description
0 Error occurred during the attempt to send the message to the pager
1 Pager message was transmitted successfully
PARAMETERS
Message: the message to be displayed in the status bar.
Delay: an optional delay, after which time the message is removed from the status
bar.
RETURNED XML
<GMAPI call="StatusMsg">
<status code="1">Success</status>
</GMAPI>
PARAMETER
The SyncStamp function takes one parameter, Stamp.
220
Integrating With GoldMine
RETURN VALUES
When the Stamp parameter is exactly 17 characters long, formatted as Date:Time in
form of CCYYMMDD:HH:MM:SS, the return string is in TLog time stamp format,
exactly seven characters long. When the Stamp parameter is seven characters long,
and formatted as a TLog timestamp, the return string is formatted as
CCYYMMDD:HH:MM:SS. An empty return string indicates an error.
RETURNED XML
<GMAPI call="SyncStamp">
<status code="1">A6P9FC8</status>
</GMAPI>
PARAMETERS
Table specifies the table name (such as “Contact1”) or the table ID.
RecID specifies the RecID of the updated record: the correct RecID must be passed,
and the RecID value must be exactly 15 characters long.
Field specifies the name of the field that has changed. This parameter is only relevant
when the Action parameter is U. Field is ignored when Action is N or D.
Action should be N when a new record has been appended, D when a record has
been deleted, or U when a field in a record has been updated.
RETURN VALUES
The UpdateSyncLog function returns the following XML:
<GMAPI call="UpdateSyncLog">
<status code="4">Field TLog entry created.</status>
</GMAPI>
221
Integrating With GoldMine
Return Description
8 Field TLog entry updated
16 Deleted record TLog entry created
32 New TLog Entry removed
SYNTAX
PARAMETERS
File specifies the import file name—see below for the import file structure.
Delete specifies to delete the import file when the process has completed.
RETURN VALUES
ReadImpTLog function returns the following values in the code attribute:
ReadImpTLog Code Attribute Values
Code Description
0 Failure
1 Success -- Text is total number of imported TLog records
NOTES
Your application can determine when the imported process completes by setting the
Delete parameter to 1, and noting when the import file is deleted. The TLog import
must have the structure shown in the following table.
TLog Import Structure
Field Name Type Length
Table ID char 10
RecID char 15
Field ID char 10
Action ID char 1
222
Integrating With GoldMine
Forcing Logout
SYNTAX
PARAMETERS
LogoutSelf: specifies if the currently logged in user should also be logged out. 1 for
rue, 0 for false.
Relogin: Set to 1 to indicate for GoldMine to relogin after the users are logged out.
InMinutes: Specifies the number of minutes to wait before forcing the logout.
SYNTAX
XML < =
GMAPI call "UserAccess"/>
This command returns a data element for each of the following permissions for the
logged in user. The text value of the data element will be either 0 or 1, indicating if
the permission is granted for the user.
Permissions Returned by UserAccess
Rights
Master Rights
Other User Calendar Access
Other User History Access
Other User Sales Access
Other User Report Access
Other User Merge Form Acccess
Other User Filter Access
Other User Groups Access
Other User Links Access
Create Records
223
Integrating With GoldMine
Rights
Edit Records
Delete Records
Change Owner
Field Views
Schedule APs
SQL Queries
NetUpdate
Build Groups
RETURNED XML
<GMAPI call="UserAccess">
<status code="1">Success.</status>
<data name="return">
<data name="Master Rights">1</data>
<data name="Other User Calendar Access">1</data>
<data name="Other User History Access">1</data>
<data name="Other User Sales Access">1</data>
<data name="Other User Report Access">1</data>
<data name="Other User Merge Form Access">1</data>
<data name="Other User Filter Access">1</data>
<data name="Other User Groups Access">1</data>
<data name="Other User Links Access">1</data>
<data name="Create Records">1</data>
<data name="Edit Records">1</data>
<data name="Delete Records">1</data>
<data name="Change Owner">1</data>
<data name="Field Views">1</data>
<data name="Schedule APs">1</data>
<data name="SQL Queries">1</data>
<data name="NetUpdate">1</data>
<data name="Build Groups">1</data>
</data>
</GMAPI>
224
Integrating With GoldMine
SYNTAX
<GMAPI call=”CalAccess”>
<data name=”RecordType”>C</data>
<data name=”User”>KEVIN</data>
XML
<data name=”Number1”>22</data>
</GMAPI>
PARAMETERS
Pass this command the record type and number1 value from the calendar record in
question. Also pass the user you wish to query if they have permission to this record
or not.
RecordType is the RecType of the record.
User is the UserID of the record.
Number1 is the Number1 value of the record.
RETURN VALUES
The CalAccess function returns 1 if the user has rights to read/write.
SYNTAX
<GMAPI call=”HistAccess”>
<data name=”RecordType”>C</data>
XML <data name=”User”>KEVIN</data>
</GMAPI>
PARAMETERS
Pass this command the record type value from the calendar record in question. Also
pass the user you wish to query if they have permission to this record or not.
RecordType is the RecType of the record.
User is the UserID of the record.
RETURN VALUES
The HistAccess function returns 1 if the user has rights to read/write.
Macros
To facilitate the use of DDEAUTO fields, GoldMine allows you to select a macro as
the service item. Upon encountering a DDE service item that starts with an
ampersand (&), GoldMine searches an internal table of macro names. If a match is
found, the macro is processed and the result is returned, as if a DDE function or
225
Integrating With GoldMine
expression had been used. The GoldMine COM Server recognizes these same
macros for use in such methods as Expr and Macro.
Most macros are sensitive to the setting of the RECORDOBJ function’s SETRECORD
subfunction. This function is used primarily to gain access to additional contacts and
other supplementary information. When the SETRECORD type is set to PRIMARY,
the following macros will return the value from the corresponding fields in the
primary information portion of the contact record. When the SETRECORD type is
set to CONTACTS (additional contacts), or another supplementary record type, the
macros will return the value from the corresponding field in the supplementary file
(CONTSUPP.DBF).
Executing Macros
To evaluate any of the macros described in this section, use the Macro command for
the GoldMine COM Server.
<GMAPI call=”Macro”>
Syntax <data name=”Macro”>&FullAddress</data>
</GMAPI>
RETURNED XML
The XML returned will of course vary based on the Macro requested.
For the example in the Syntax table above, the XML returned is:
<GMAPI call="Macro">
<status code="1">1150 Kelly Johnson Blvd. Colorado Springs, CO 80920
</status>
</GMAPI>
226
Integrating With GoldMine
&Address1 Returns the first Address field from the active contact record. Typically, this
value will be extracted from the Address1 field in the primary display
portion of the contact record; however, when the RECORDOBJ
SETRECORD subfunction has been used to change the returned record
type to CONTACTS, then GoldMine returns the value from the Address1
field on the additional contact record, if a value is entered. When the
Address1 field on the additional contact record is blank, then the
&Address1 macro returns the value in the Address1 field in the primary
display portion of the contact record. When the RECORDOBJ
SETRECORD type is set to return a record type other than CONTACTS,
the &Address1 macro returns the value in Address1 field in the primary
display portion of the contact record.
&Address2 Returns the second Address field from the active contact record. Typically,
this value will be extracted from the Address2 field in the primary display
portion of the contact record; however, when the RECORDOBJ
SETRECORD subfunction has been used to change the returned record
type to ADDITIONAL, then GoldMine returns the value from the Address2
field on the additional contact record, if an entry exists in the Address2 field
on the additional contact record. When the Address2 field on the additional
contact record is blank, then the &Address2 macro returns the value in the
Address2 field in the primary display portion of the contact record. When
the RECORDOBJ SETRECORD type is set to return a record type other
than PRIMARY or ADDITIONAL, the &Address2 macro returns the value
in the Address2 field of the primary display portion of the contact record.
&BrowseRecNo Xbase: Returns the record number of the last selected record in a browse
window.
SQL: Returns the record ID of the last selected record in a browse window.
&City Returns the City field from the active contact record. The action of this
macro string is similar to the action of &Address1. The &City macro can
be used to return an additional contact city by using the RECORDOBJ
SETRECORD subfunction.
&CityStateZip Returns a format string of text containing the City, State, and Zip fields
from the active contact record. This string is returned in the following format:
City, State Zip
The action of this macro string is similar to the action of &Address1. The
&CityStateZip macro can be used to return an additional contact city,
state, and ZIP Code by using the RECORDOBJ SETRECORD
subfunction.
&CommonDir Xbase: Returns the path information for the directory where the contact
sets are located.
SQL: Returns the BDE alias where the contact sets are located.
227
Integrating With GoldMine
&Contact Returns a Contact name from the active contact record. Normally, this
value will be extracted from the Contact field in the primary display portion
of the contact record; however, the RECORDOBJ SETRECORD
subfunction can be used to change the returned record type to additional
contact, or another type of supplementary record. When the RECORDOBJ
SETRECORD type is set to return record types other than PRIMARY, the
&Contact macro returns the value in Contact field in CONTSUPP for the
current supplementary record.
&Country Returns the Country field from the active contact record. The action of this
macro string is similar to the action of &Address1. The &Country macro can
be used to return an additional contact country by using the RECORDOBJ
SETRECORD subfunction.
&Dial1 Returns the Phone1 entry from the active contact record. The returned
phone number is formatted for dialing. GoldMine applies the same rules
used to dial the phone via TAPI. If selected, PREDIAL.INI settings are
applied to phone number selection.
&Dial2 Returns the Phone2 entry from the active contact record. For details, see
&Dial1 above.
&Dial3 Returns the Phone3 entry from the active contact record. For details, see
&Dial1 above.
&DialFax Returns the FAX entry from the active contact record. For details, see
&Dial1 above.
&EmailAddress Returns the primary e-mail address for the currently selected contact.
&Fax Returns the fax number as it should be sent to an auto-dialer for automatic
fax transmission.
&FullAddress Returns a string containing the complete address for the contact record,
composed of values of &Address1, &Address2, &City, &State, and &ZIP.
The action of this macro string is similar to the action of &Address1. The
&FullAddress macro can be used to return an additional contact address by
using the RECORDOBJ SETRECORD subfunction.
228
Integrating With GoldMine
&GetRoTabID Returns the ID of the currently selected tab. Typically, this value will verify
that the correct tab is selected when a user starts a custom application.
0 = Summary
1 = Fields
2 = GM+View
3 = Notes
4 = Contacts
5 = Details
6 = Referral
7 = Pending
8 = History
9 = Links
10 = Members
11 = APs/Tracks
12 = Opportunities
13 = Projects
14 = Relationships/Org tree
15 = Cases
16 = HEAT View if installed, else it will go to the first tab
17+ = custom if installed, otherwise the first tab
<GMAPI call="Macro">&GetROTabID</GMAPI>
Returns:
<GMAPI call="Macro"><status
code="1">1</status></GMAPI>
&GetRoTabPos Returns the currently selected tab position. Since the tabs can be
rearranged, this method is not always reliable for determining the currently
selected tab. For details, see &GetRoTabID.
&GoldDir Xbase: Returns path information for the directory in which GoldMine is
installed.
SQL: Returns path information for BDE alias in which GoldMine is installed.
&LicUsers Returns the number of concurrent users allowed to log in to the installed
copy of GoldMine.
&LicUsersAvailable Returns the number of users allowed to log in to the installed copy of
GoldMine license.
229
Integrating With GoldMine
&NameAddress Returns a string containing the contact’s name, company, and complete
address of the current contact record. Each address line is separated by a
carriage return and line feed, and the entire string is formatted so that the
string can be inserted directly into a merge template. If any of the address
lines on the contact record is empty, that address line will be suppressed.
This macro can be used to perform rudimentary blank line suppression
within linked applications that do not support blank address line
suppression internally.
The action of this macro string is similar to the action of the &ADDRESS
macros, and the &NAMEADDRESS macro can be used to return an
additional contact address by using the RECORDOBJ SETRECORD
subfunction.
&NameTitleAddress Returns a string containing the contact’s name, title, department, company,
and complete address of the current contact record. Each line is separated
by a carriage return and line feed, and the entire string is formatted so that
the string can be inserted directly into a merge template. If any of the lines
on the contact record is empty, that line will be suppressed. This macro can
be used to perform rudimentary blank line suppression within linked
applications that do not support blank address line suppression internally.
The action of this macro string is similar to the action of the &ADDRESS
macros, and the &NAMETITLEADDRESS macro can be used to return an
additional contact address by using the RECORDOBJ SETRECORD
subfunction.
&NewRecID Returns a unique record ID, which can be used when creating new records.
&Notes Returns the Notes from the active contact record. Typically, this value will
be extracted from the Notes field in the primary display portion of the
contact record; however, the RECORDOBJ SETRECORD subfunction can
be used to change the returned record type to additional contact, or another
type of supplementary record. When the RECORDOBJ SETRECORD type
is set to other than PRIMARY, the &TITLE macro returns the value in Notes
field in CONTSUPP for the current supplementary record.
230
Integrating With GoldMine
&PROFILE EXAMPLE 1
&Profile.ProfileName.Reference.Flags
Retrieves the first profile that matches the ProfileName and Reference.
The Reference parameter is optional. If passed, the Reference parameter
acts as a “begin with” condition on the profile reference. If the Reference
parameter is not passed, all ProfileName profiles are evaluated.
The optional Flags parameter has the following values:
2 Returns the extended profile fields
4 Returns the ProfileName and Reference
The &Profile(s) macro can easily fill in a Word table with the selected
contact’s profile information because tabs separate each field value, and a
CR/LF separates each profile record.
&PROFILE EXAMPLE 2
The following example returns the first e-mail address of the contact:
&Profile.E-mail Address
&PROFILES EXAMPLE 1
The following example returns all the computer profiles that begin with the
word notebook:
&Profiles.Computer.Notebook
&PROFILES EXAMPLE 2
The following examples use the Flags parameter to specify the profile fields
to return:
&Profiles.Computer.Notebook
Notebook ThinkPad 770|
Notebook Compaq Elite|
Notebook Dell 1200|
&Profiles.Computer.Notebook.2
Computer|Notebook ThinkPad 770|
Computer|Notebook Compaq Elite|
Computer|Notebook Dell 1200||
&Profiles.Computer.Notebook.4
Computer|Notebook ThinkPad 770|IBM|233Mz|
Computer|Notebook Compaq Elite|Compaq|200mz|
Computer|Notebook Dell 1200|Dell|166mz|
231
Integrating With GoldMine
&ProgramDataDir Returns the place where the GM.ini, user.ini, and anything that needs to
have read/write access in GoldMine can be found. This is important for
Vista. It is very similar to the split path installs that GoldMine had when
Windows XP was released. For non split paths, it will return the SysDir.
Example:
<GMAPI call="Macro">Programdatadir</GMAPI>
Returns :
<GMAPI call="Macro"><status
code="1">c:\code\GMDev8.0_Main\bin\debug\</s
tatus></GMAPI>
&RoTabPage Returns the currently selected tab. Typically, this value will verify that the
correct tab is selected when a user starts a custom application. Values
between 1 and 9 represent tabs in the first row of tabs; for example, 1
represents the Summary tab. Values between 10 and 18 represent tabs in
the second row, and 19–27 represent tabs in the third row.
&SetRoTab# Selects the tab that corresponds to the number (represented by #) in the
active contact record.
1 = Summary
2 = Fields
3 = GM+View
4 = Notes
5 = Contacts
6 = Details
7 = Referral
8 = Pending
9 = History
10 = Links
11 = Members
12 = APs/Tracks
13 = Opportunities
14 = Projects
15 = Relationships/Org tree
16 = Cases
17 = HEAT View if installed, else it will go to the first tab
18+ = custom if installed, otherwise the first tab
Example:
<GMAPI call="Macro">&SetROTab4</GMAPI>
232
Integrating With GoldMine
&ShutDown Logs out the currently logged user, and quits GoldMine.
&State Returns the State field from the active contact record. The action of this
macro string is similar to the action of the &ADDRESS1. The &STATE
macro can be used to return an additional contact state by using the
RECORDOBJ SETRECORD subfunction.
&Title Returns the Title from the active contact record. Normally, this value will be
extracted from the Title field in the primary display portion of the contact
record; however, the RECORDOBJ SETRECORD subfunction can be
used to change the returned record type to additional contact, or another
type of supplementary record. When the RECORDOBJ SETRECORD type
is set to other than PRIMARY, the &TITLE macro returns the value in Title
field in CONTSUPP for the current supplementary record.
&User_Var Returns the defined field value from all users, a specified user, or the
currently logged user. For details on defining values, see “Defining Field
Values for use with External Applications” in Maintaining GoldMine.
The &User_Var macro allows GoldMine users to store specific data that
can be retrieved later into applications that are linked with GoldMine. This
macro can be defined in the [user_var] section of both the GM.INI and the
username.INI of GoldMine.
Usage Syntax:
&User_Var.<variable name>.<GoldMine username>
Example:
&User_Var.Territory.Dan
(Where <variable name> is a descriptive name of the macro and
<GoldMine username> assigns a defined value to a specific GoldMine
user.) <GoldMine username> is optional, as GoldMine will assign these
values to the current GoldMine user.
&UserFullName Returns the full name of the currently logged GoldMine user as the name
appears in the FullName field in the Users Master File for the user.
&UserName Returns the login name of the currently logged GoldMine user.
&ZIP Returns the Zip field from the currently active contact record. The action of
this macro string is similar to the action of the &ADDRESS1. The &ZIP
macro can be used to return an additional contact ZIP Code by using the
RECORDOBJ SETRECORD subfunction.
233
Integrating With GoldMine
&PARAM1 Returns the path and filename of the document template associated with the merge
(filename) form selected when Edit, Link, Print, or Fax was selected. This value is obtained
from the Template File field in the merge form’s Form Setting dialog box.
&PARAM2 Returns a value indicating whether the Edit, Link, Print, or Fax button was selected
(action) to launch linked application.
&PARAM2 Parameters
Value Description
1 Edit selected
2 Link selected
3 Print selected
4 Fax selected
&PARAM3 Returns a value corresponding to the setting of the Record Range options on the
(range) Merge Forms dialog box when the Edit, Link, Print, or Fax button was selected.
&PARAM3 Parameters
Value Description
1 This contact selected
2 All contacts selected
3 Forward to last selected
&PARAM4 Returns a value corresponding to the setting of the Primary and Additional check
(scope) boxes on the Merge Forms dialog box when the Edit, Link, Print, or Fax button
was selected.
&PARAM4 Parameters
Value Description
1 Primary checked
2 Additional checked
3 Both Primary and Additional checked
&PARAM5 Returns a value corresponding to the status of the Link to Doc, Save History,
(flags) and/or Allow Hot Link check boxes on the Merge Forms dialog box. In addition,
the returned value determines whether the form was merged as the result of an
Automated Processes action.
Returns a seven-character string. Each position of the string can contain either 0,
indicating the item was not checked (or Automated Processes is not active), or 1,
indicating the item was checked (or Automated Processes is active).
&PARAM5 Parameters
Position Description
1 Link to Doc
2 Save History
234
Integrating With GoldMine
Position Description
3 Allow Hot Link
4 Unused
5 Unused
6 Unused
7 Automated Processes status
&PARAM6 Returns a value containing the record number of the last Linked Document
(LinkDoc supplementary record created as a result of launching a Merge Form. When you
record launch a merge form with Link to Doc selected, GoldMine creates a linked
number) document record to hold the saved document. This value can be saved and used to
update the linked document record by passing the record number to the LinkDoc
function.
&PARAM7 Returns a pointer to a minimized contact record that is created when Print or Fax is
(contact selected on the Merge Forms dialog box, and the Record Range is All Contacts
record or Forward to Last. This value can then be passed to the RecordObj function to
pointer) further control a document merge from the linked application.
&PARAM8 Returns the merge code entered in the Merge code field of the Merge Forms
(merge code dialog box.
value)
&PARAM9 Returns the RecNo or RecID of the history record created by GoldMine. This macro
(history is useful for updating the history record.
record)
&LicInfo_Contact Returns the Contact Name entry from the registration form.
&LicInfo_LicEmail Returns the E-mail address entry from the registration form.
&LicInfo_Phone Returns the telephone number entry from the first Phone/Fax field.
&LicInfo_Fax Returns the fax number entry from the second Phone/Fax field.
&LicInfo_City Returns the city entry from the first City/State field.
&LicInfo_State Returns the state or province entry from the second City/State field.
&LicInfo_Zip Returns the ZIP Code entry from the first Zip/Country field.
235
Integrating With GoldMine
&LicInfo_Country Returns the country entry from the second Zip/Country field.
GETAVAILABLEWINDOWSLIST
GetAvailableWindowsList returns all of the available GoldMine windows in XML
format.
SYNTAX
XML < =
GMAPI call "GetAvailableWindowsList"/>
RETURNED XML
The XML returned is a long list of available windows for GoldMine. It has the
following format. This represents a truncated list of available windows. The actual
list is too extensive to list in this document. All window names are descriptive and
self-explanatory as to which window they represent. Send the
GetAvailableWindowList command for a complete list of windows.
<GMAPI call="GetAvailableWindowsList">
<status code="1">Success</status>
<data name="WindowsList">
<data name="window">DIALOGFILEDFOLDERPROPERTIES</data>
<data name="window">DIALOGMAILSEARCH</data>
<data name="window">DIALOGEMAILACCNTPROPS</data>
236
Integrating With GoldMine
<data name="window">DIALOGEMAILAUTOFILEMONTH</data>
<data name="window">DIALOGDIGITALIDEXPORTPRIVATE</data>
<data name="window">DIALOGSOFTPHONE</data>
<data name="window">DIALOGSIP_SP_SETTINGS</data>
</data>
</GMAPI>
GETACTIVEWINDOWSLIST
The GetActiveWindowsList supplies detailed information regarding the windows
and dialog boxes currently active in GoldMine.
SYNTAX
XML < =
GMAPI call "GetActiveWindowsList"/>
RETURNED XML
Below is an example XML document describing one active window, the current
contact screen. For an accurate representation of the window you wish to control,
call GetActiveWindowsList with that window active. Doing so will provide a
reference for programming your integration.
All window elements are stored in the WindowsList element. Each Window has
child elements providing detailed information about the window. Some child
elements store additional child elements when further nesting is required to provide
all properties of the windows and the controls they contain. Commands that
manipulate the controls on a window expect the handle the parent window (hwnd)
and the control’s id, along with the properties of the control that are being changed.
Retrieve the hwnd and the control id from the GetActiveWindowsList command.
<GMAPI call="GetActiveWindowsList">
<status code="1">Success</status>
<data name="WindowsList">
<data name="window">
<data name="hWnd">197868</data>
<data name="WindowName">OBJECTCURRENTGMRECORD</data>
<data name="WindowInternalName">OBJECT: GMRECORD</data>
<data name="Caption">FrontRange Solutions, Inc.</data>
<data name="WinType">Window</data>
<data name="WindowRect">
<data name="Left">140</data>
<data name="Right">722</data>
<data name="Bottom">484</data>
<data name="Top">81</data>
</data>
<data name="ClientRect">
<data name="Left">144</data>
<data name="Right">718</data>
<data name="Bottom">480</data>
237
Integrating With GoldMine
<data name="Top">111</data>
</data>
<data name="Controls">
<data name="msctls_updown32">
<data name="Enabled">1</data>
<data name="Visible">1</data>
<data name="ParentID">197868</data>
<data name="hWnd">1770672</data>
<data name="ID">700</data>
</data>
<data name="msctls_updown32">
<data name="Enabled">1</data>
<data name="Visible">1</data>
<data name="ParentID">197868</data>
<data name="hWnd">66798</data>
<data name="ID">704</data>
</data>
<data name="gmWndBrowse">
<data name="Enabled">1</data>
<data name="Visible">1</data>
<data name="ParentID">197868</data>
<data name="hWnd">66812</data>
<data name="ID">1003</data>
<data name="Text">History of FrontRange Solutions,
Inc.</data>
<data name="Controls">
<data name="ScrollBar">
<data name="Enabled">1</data>
<data name="Visible">1</data>
<data name="ParentID">66812</data>
<data name="hWnd">66814</data>
<data name="ID">100</data>
</data>
</data>
</data>
</data>
</data>
</GMAPI>
238
Integrating With GoldMine
REGISTERVETOWINDOWLAUNCH
RegisterVetoWindowLaunch subscribes to an event for the specified window giving
the integration the opportunity to either veto or allow the window launch.
SYNTAX
PARAMETERS
Window: the name of the window to monitor. The GetAvailableWindowsList
command provides valid window names.
Only dialog boxes can be vetoed. For example, the schedule and complete
windows are dialog boxes. Core GoldMine windows cannot be vetoed (the
record object, the email center, etc)
Monitor: specifies to either begin monitoring for the event (1) or to unsubscribe from
the event (0).
RETURNED XML
The following XML is returned:
<GMAPI call="RegisterVetoWindowLaunch">
<status code="1">Success</status>
</GMAPI>
For information on handling the event, see Handling GoldMine.UI Events below.
REGISTERWINDOWUPDOWN
RegisterWindowUpDown subscribes to an event for the specified window notifying
the integration when the desired window is launching or closing.
SYNTAX
PARAMETERS
Window: the name of the window to monitor. The GetAvailableWindowsList
command provides valid window names.
Monitor: specifies to either begin monitoring for the event (1) or to unsubscribe from
the event (0).
239
Integrating With GoldMine
RETURNED XML
The following XML is returned:
<GMAPI call="RegisterWindowUpDown">
<status code="1">Success</status>
</GMAPI>
For information on handling the event, see Handling GoldMine.UI Events below.
REGISTERCOMMANDEXEC
RegisterCommandExec is used to subscribe to events raised when a particular
control is manipulated on the specified window. For example, your application can
receive notification when the user combo (dropdown) box is changed on the
Schedule a Call dialog.
SYNTAX
<GMAPI call="RegisterCommandExec">
<data name="Window">DialogScheduleDefault</data>
<data name="ControlID">1</data>
XML <data name="CommandID">0</data>
<data name="Monitor">1</data>
</GMAPI>
PARAMETERS
Window: The name of the window to monitor. The GetAvailableWindowsList
command provides valid window names.
ControlID: The ID of the control to monitor. This ID is provided in the child
elements for the specified window provided by the
GetAvailableWindowsList.
CommandID: The type of event to monitor (i.e. button clicked). The possible values
for the CommandID are enumerated within the GoldMine object.
Provided notification command ID’s include ButtonStates,
ComboBoxStates, EditControlNotifications, and ListBoxNotifications.
The CommandID enumerations can be viewed in the Object Browser in
Visual Basic 6.0
Monitor: Specifies to either begin monitoring for the event (1) or to unsubscribe from
the event (0).
RETURNED XML
The following XML is returned:
<GMAPI call="RegisterCommandExec">
<status code="1">Success</status>
</GMAPI>
For information on handling the event, see Handling GoldMine.UI Events below.
240
Integrating With GoldMine
REGISTERTABDETAILSEVENTS
RegisterTabDetailsEvents is used to subscribe to events raised when a particular
Record Object Tab is manipulated. For example, your application can receive
notification when the user clicks on an item in a tab, but without the item being
zoomed or opened.
SYNTAX
<GMAPI call="RegisterTabDetailsEvents">
XML <data name="Monitor">1</data>
</GMAPI>
PARAMETERS
Monitor: Specifies to either begin monitoring for the event (1) or to unsubscribe from
the event (0).
The following tab events are monitored:
Event Data Passed
AdditionalContactClick RecID,AccountNo,Reference,Phone,Contact
AdditionalContactEditClick (7.5 or higher) RecID,AccountNo,Reference,Phone,Contact
AdditionalContactNewClick (7.5 or higher) AccountNo (of the contact it will be attached to)
DetailsClick RecID,AccountNo,Type,Reference
DetailsEditClick (7.5 or higher) RecID,AccountNo,Type,Reference
DetailsNewClick (7.5 or higher) AccountNo
ReferralClick RecID,LinkedRecID,LinkedAccountNo,Referral,Reference
ReferralAddClick RecID (the recid of the referrer,not the referree)
ReferralEditClick (7.5 or higher) RecID,LinkedRecID,LinkedAccountNo,Referral,Reference
LinkedDocClick RecID,FileName,Sync,UserName
LinkedDocAddClick Returns Account No of current contact
LinkedDocEditClick (7.5 or higher) RecID,FileName,Sync,UserName
PendingEditClick (7.5 or higher) RecID,AccountNo,RecType,UserName
PendingClick RecID,AccountNo,RecType,UserName
ScheduleNew (7.5 or higher) AccountNo,RecType,UserName
HistoryEditClick (7.5 or higher) RecID,AccountNo,RecType,UserName
HistoryClick RecID,AccountNo,RecType,UserName
The following Case tab events are also monitored. Each event returns the RecID of
the selected case:
Event (All are 8.0 or higher only) User Action Returns
CaseReassign Reassign the case RecID
CaseEscalate Escalate the case RecID
CaseResolve Resolve the case RecID
CaseAbandon Abandon the case RecID
CaseGoto Open the case RecID
CaseSaveAsTemplate Save the case as a template RecID
CaseDelete Delete the case RecID
241
Integrating With GoldMine
ADDITIONALCONTACTCLICK
RETURNED XML
The following XML is returned for AdditionalContactClick:
<GMAPI event="AdditionalContactClick">
<RecID>99UZA3O%R*O%H?$</RecID>
<AccountNo>A1121345737(>C9^HBob</AccountNo>
<Reference/>
<Phone/>
<Contact>Frances</Contact>
</GMAPI>
PARAMETERS
RecID: The record ID for the additional contact.
AccountNo: The account number of the parent contact.
Reference: The reference field value.
Phone: The phone field value.
DETAILSCLICK
RETURNED XML
The following XML is returned for DetailsClick:
<GMAPI event="DetailsClick">
<RecID>99UZC5R(*2!2H?$</RecID>
<AccountNo>A1121345737(>C9^HBob</AccountNo>
<Type>E-mail Address</Type>
<Reference>[email protected]</Reference>
</GMAPI>
PARAMETERS
RecID: The record ID for the detail.
AccountNo: The account number of the contact.
Type: The type of the detail.
Reference: The reference field value.
PENDINGCLICK
RETURNED XML
The following XML is returned for PendingClick:
<GMAPI event="PendingClick">
<RecID>BA5OXQT%ZO9K]WV</RecID>
242
Integrating With GoldMine
<AccountNo>A1121345737(>C9^HBob</AccountNo>
<RecType>C</RecType>
<UserName>GUY</UserName>
</GMAPI>
PARAMETERS
RecID: The record ID for the pending item.
AccountNo: The account number of the contact.
RecType: The record type of the pending item.
UserName: The owner name.
HISTORYCLICK
RETURNED XML
The following XML is returned for HistoryClick:
<GMAPI event="HistoryClick">
<RecID>BA4U3BK%BK!J]WV</RecID>
<AccountNo>A1121345737(>C9^HBob</AccountNo>
<RecType>L</RecType>
<UserName>GUY</UserName>
</GMAPI>
PARAMETERS
RecID: The record ID for the history item.
AccountNo: The account number of the contact.
RecType: The record type of the history item.
UserName: The owner name.
LINKEDDOCCLICK
RETURNED XML
The following XML is returned for LinkedDocClick:
<GMAPI event="LinkedDocClick">
<RecID>BAAVH43(C?LC]WV</RecID>
<FileName>C:\documents and settings\john stillman\my
documents\visual studio projects\gmdev\bin\debug\MailBox\Attach\There
ya go2.doc</FileName>
<Sync>1</Sync>
<UserName>GUY</UserName>
</GMAPI>
243
Integrating With GoldMine
PARAMETERS
RecID: The record ID for the linked document.
FileName: The path to the linked document.
Sync: 1 or 0 for is the doc synced.
UserName: The last user to use the document (not the owner).
For information on handling these events, see Handling GoldMine.UI Events below.
NOTIFYCONTROLCOMMAND
NotifyControlCommand is the event that notifies a client application that a button
has been pressed, a checkbox marked, or any other control change/activation event.
Register for this event by calling RegisterCommandExec.
PARAMETERS
sWindowName: This is a string (BSTR) that contains the nam of the window being
called.
ControlID: a long that contains the ID of the control that is notifying.
CmdID: a long that contains the command that is being triggered
HWnd: a long that represents the hWnd of the Parent to the control.
VETOWINDOW
The VetoWindow event is used to notify a client application that a window or dialog
is requesting to be launched. The client application returns a Boolean answer as to
whether or not to allow the window/dialog to launch. Subscribe to this event by
calling RegisterVetoWindowLaunch.
PARAMETERS
sWindowName: a string (BSTR) that contains the name of the window being called.
Delphi does not support functions (a sub that returns a value) in its COM
handler. Within the VetoWindow event handler, Delphi users need to set a
special property within the GoldMine.UI class to indicate whether or not to
veto the window.
Example:
GMObj.VetoWindowDelphi:=true
244
Integrating With GoldMine
EXAMPLE
The following example uses Visual Basic 6.0. After declaring your object using the
WithEvents keyword, Visual Basic will place the name of the object in the drop
down on the upper left of your code window. Select your object from that drop
down to view the list of event handling subs/functions available for that object. For
the VetoWindow event the function will be called Objectname_VetoWindow. For an
example handling an event in VB.NET using delegate functions, see the
GoldMineShutdown event for the GoldMine.GMSystemEvents class.
docResult.loadXML sResult
End If
End Function
245
Integrating With GoldMine
WINDOWUPDOWN
The purpose of the WindowUpDown event is to notify the client application that a
particular window is coming up or shutting down. This does not apply to the main
GoldMine application window. To be notified that GoldMine is shutting down, use
the GoldMineShutdown event in the GoldMine.GMSystemEvents class.
This event is useful for a client application to perform additional processing of
record data after the user has submitted it by pressing OK on a dialog box. For
example, data can be linked to other third party applications in real time.
PARAMETERS
sName: a string (BSTR) that contains the name of the window being called.
bUp: a Boolean which represents True=Up and False=Down
GMEVENT
GMEvent is an omni-event holder that can provide information about what is
happening in the GoldMine application, and in some cases it can affect an action in
GoldMine.
VARIANT_BOOL GMEvent(VARIANT_BSTR sXML)
sXML is XML that describes the event - possible events are UI events:
VetoWindow - same as the 6.7 event - looks like
<GMAPI event="VetoWindow">
<WindowName>NAME_OF_WINDOW_HERE</WindowName>
</GMAPI>
if event returns TRUE to GM then the window will not be launched
WindowUpDown - same as the 6.7 event - returns
<GMAPI event="WindowUpDown">
<WindowName>NAME_OF_WINDOW_HERE</WindowName>
<Up/>
<WindowhWnd>399692</WindowhWnd>
</GMAPI>
if the window is being closed, then a Down node will appear instead of the Up node
NotifyControlCommand - same as the 6.7 event - returns
<GMAPI event="NAME_OF_WINDOW_HERE">
<WindowName>DIALOGSCHEDULEDEFAULT</WindowName>
<ID>1</ID>
<Command>0</Command>
<WindowhWnd>97256300</WindowhWnd>
</GMAPI>
the following are the new events specific to 7.0 and only can be used with the
GMEvent structure
246
Integrating With GoldMine
247
Integrating With GoldMine
5 - Outline
6 - PegBoard
PrvView - the view it is changing from
NewView - the view it is changing to
Returning TRUE to this event blocks the view change
CalendarUserSelectionChanged - tells the consumer that the user selection of visible
user events has changed.
<GMAPI event="CalendarUserSelectionChanged">
<Users>GUY,MASTER</Users>
<CurrentView>0</CurrentView>
</GMAPI>
Users - a comma delimited list of users that are shown in the calendar.
CurrentView - the current view
VetoCalendarNextClick - can block the user from hitting the next button
returns
<GMAPI event="VetoCalendarNextClick"/>
returning TRUE to this event keeps the user on the current selection
VetoCalendarPreviousClick - can block the user from hitting the previous button
<GMAPI event="VetoCalendarPreviousClick"/>
returning TRUE to this event keeps the user on the current selection
PRESSBUTTON
Use PressButton to press a button on a known form.
248
Integrating With GoldMine
SYNTAX
PARAMETERS
hWndParent: the handle to the parent window containing the control. Corresponds
to the ParentID element returned for the control by the
GetActiveWindowsList command.
ID: the ID of the control. Corresponds to the ID element returned for the control by
the GetActiveWindowsList command.
SETCONTROLTEXT
SetControlText sets the text property of the specified control.
249
Integrating With GoldMine
SYNTAX
The Filters and Groups dialog contains the following control, the SQL
field:
<data name=”Edit”>
<data name=”Enabled”>1</data>
<data name=”Visible”>1</data>
<data name=”ParentID”>398370</data>
<data name=”hWnd”>726100</data>
<data name=”ID”>104</data>
XML </data>
To set the text for this control, the following XML should be sent:
<GMAPI call=”SetControlText”>
<data name=”hWndParent”>398370</data>
<data name=”ID”>104</data>
<data name=”Text”>SELECT * FROM contact1</data>
</GMAPI>
PARAMETERS
hWndParent: the handle to the parent window containing the control. Corresponds
to the ParentID element returned for the control by the
GetActiveWindowsList command.
ID: the ID of the control. Corresponds to the ID element returned for the control by
the GetActiveWindowsList command.
Text: the text desired for the control.
250
Integrating With GoldMine
SETCHECKBOX
SetCheckBox sets the value of a check box control.
SYNTAX
PARAMETERS
hWndParent: the handle to the parent window containing the control. Corresponds
to the ParentID element returned for the control by the
GetActiveWindowsList command.
ID: the ID of the control. Corresponds to the ID element returned for the control by
the GetActiveWindowsList command.
Checked: 1 to check the checkbox, 0 to uncheck
SELECTRADIO
The SelectRadio command allows an application to set a radio button array, or a
single item. While the command allows a single radio button to be set, this is not the
best practice. Doing so results in more than one radio button selected in a group or
radio buttons.
251
Integrating With GoldMine
SYNTAX
PARAMETERS
hWndParent: the handle to the parent window containing the control. Corresponds
to the ParentID element returned for the control by the
GetActiveWindowsList command.
ID: the ID of the control. Corresponds to the ID element returned for the control by
the GetActiveWindowsList command.
Value: 1 to select the radio button, 0 to unselect
SETLISTBOX/SETCOMBOBOX
Use the SetListBox/SetComboBox command(s) to select an item in a listbox on a
GoldMine dialog box. The client application can specify either a text value or an
index. If a text value is used, the value must already exist within the list.
252
Integrating With GoldMine
SYNTAX
PARAMETERS
hWndParent: the handle to the parent window containing the control. Corresponds
to the ParentID element returned for the control by the
GetActiveWindowsList command.
ID: the ID of the control. Corresponds to the ID element returned for the control by
the GetActiveWindowsList command.
Value: the TEXT value to select in the combobox or listbox. The value must already
exist in the list of the control.
OR
Index: the index number of the item to be selected in the combo box or list box.
SELECTTAB
Use SelectTab to select a particular tab on a dialog box. This command does not
select the tabs on the contact record. Use the SetRoTabX command for that purpose.
253
Integrating With GoldMine
SYNTAX
The SelectTab command may not function as expected on all tabs within
GoldMine. Due to the way some dialog boxes were developed, changing
the tab with the SelectTab command may not cause the correct controls to
be displayed on the desired tab. Always test the SelectTab command on
the dialog box you wish to execute it for during development of your
application to verify it correctly switches the tab.
PARAMETERS
hWndParent: the handle to the parent window containing the control. Corresponds
to the ParentID element returned for the control by the
GetActiveWindowsList command.
ID: the ID of the control. Corresponds to the ID element returned for the control by
the GetActiveWindowsList command.
Index: the index number of the tab to be selected.
ENABLECTRL
The EnableCtrl command allows the programmer to enable or disable any control.
254
Integrating With GoldMine
SYNTAX
PARAMETERS
hWndParent: the handle to the parent window containing the control. Corresponds
to the ParentID element returned for the control by the
GetActiveWindowsList command.
ID: the ID of the control. Corresponds to the ID element returned for the control by
the GetActiveWindowsList command.
Enable: set to 1 to enable the control, 0 to disable.
SYNTAX
255
Integrating With GoldMine
256
Integrating With GoldMine
257
Integrating With GoldMine
RETURNED XML
The MenuCommand function returns after the menu command is executed. It does
not wait for any events on the resulting window before returning. The returned
XML for a successful call will be:
<GMAPI call="MenuCommand"><status code="1">The command was
executed.</status></GMAPI>
In the event that there is a modal window active in the GoldMine user-interface, the
COM Server cannot launch another window (as would be the case if attempting to
launch a menu item within the interface). When that occurs, the following XML is
returned to indicate a failure:
<GMAPI call="MenuCommand">
<status code="0">Access is denied.</status>
</GMAPI>
SYNTAX
PARAMETERS
RecID: the record ID of the mail item.
RETURNED XML
The OpenMailRecord function returns after the command is executed. The returned
XML for a successful call will be:
<GMAPI call="OpenMailRecord"><status code="1">The command was
executed.</status></GMAPI>
In the event that the mail record is already open, the following XML is returned to
indicate a failure:
<GMAPI call="OpenMailRecord">
<status code="-1">Already open.</status>
</GMAPI>
In the event that the system cannot open the mail record, the following XML is
returned to indicate a failure:
258
Integrating With GoldMine
<GMAPI call="OpenMailRecord">
<status code="0">Failure.</status>
</GMAPI>
SYNTAX (EXAMPLE)
PARAMETERS
hWnd: The hWnd of the gmWndBrowse you wish to set.
RecID: The recid of the value in the list you wish to select. You must pass a valid
recid that is represented in the grid.
RETURNED XML
The returned XML for a successful call will be:
<GMAPI call=”SetGridRecID”>
<status code=”1”>Success</status>
</GMAPI>
259
Integrating With GoldMine
SYNTAX (EXAMPLE)
PARAMETERS
hWnd: The hWnd of the gmWndBrowse from which you wish to get selected recids.
RETURNED XML
The returned XML for a successful call will be:
GMAPI call="GetGridRecID">
<status code="1">Success</status>
<data name="Return">
<data name="RecID">CGNPHUE)D0TV W<</data>
</data>
</GMAPI>
GoldMine.RecObj Class
The GoldMine.RecObj class contains only events. These events notify the client
application when the record object has changed, when a field has changed on the
contact record, or when the tab selected on the record object has changed. It is not
necessary to subscribe to these events, just implement the event handlers.
RECORDOBJECTHASCHANGED
The RecordObjectHasChanged event indicates when the contact displayed in
GoldMine has changed to a different contact. This does not indicate data changes.
This event is the equivalent of setting the LinkMode in Visual Basic to vbLinkNotify.
PARAMETERS
sCurrentRecord: a string that contains the AccountNo of the current record.
260
Integrating With GoldMine
RECORDFIELDHASUPDATED
The RecordFieldHasUpdated event indicates when the value of a field in contact1 or
contact2 for the current contact has been updated. This event does NOT notify when
an Email Address or Web Site has changed.
PARAMETERS
sField: a string that contains the fieldname of the updated field.
sLabel: the local label (or global if no local label is specified) of the field.
ContactTableID: the ID number of the contact table. Will be 1 for contact1 and 2 for
contact2.
RECORDTABHASCHANGED
The RecordTabHasChanged event indicates when the user in GoldMine has selected
a different tab at the bottom of the contact record screen.
PARAMETERS
sCurrentTab: the numeric representation of the tab selected.
GoldMine.GMSystemEvents Class
The GoldMine.GMSystemEvents class contains one event, GoldMineShutDown,
indicating when the GoldMine application is shutting down. This gives the client
application an opportunity to clean up and shut down as well.
GOLDMINESHUTDOWN
The GoldMineShutDown event indicates when the GoldMine application is shutting
down. It has no parameters. Following is an example of implementing the
GoldMineShutDown event in VB.NET using a delegate function. For an example
implementing an event handler in Visual Basic 6.0, see the VetoWindow event for
the GoldMine.UI class on page 244.
261
Integrating With GoldMine
262
Integrating With GoldMine
263
Integrating With GoldMine
264
Integrating With GoldMine
WriteContact Output NV
Record Description
265
Integrating With GoldMine
NAME/VALUE PAIRS
UpdateWebSite NV Pairs
Name Description
266
Integrating With GoldMine
267
Integrating With GoldMine
Name Description
Country Country
Notes Notes
LinkAcct Link Account RecID
ERROR CODES
268
Integrating With GoldMine
UField1 UField5
UField2 UField6
UField3 UField7
UField4 UField8
ERROR CODES
WriteDetailError Codes
Name Description
1 Success
0 General Failure
-1 It will be a duplicate
-2 Couldn’t create external record
-3 Couldn’t find or lock the record
-4 Couldn’t write to the database
-5 No access to the contact linked to this record
269
Integrating With GoldMine
Optional NV Pairs
Name Description
ERROR CODES
These error codes were added in GoldMine API Version: 5.70.20222
WriteLinkedDoc Error Codes
Name Description
1 Success
0 General Failure
-1 Contact not found
-2 Access denied
-3 Could not add the linked document
-4 Requested linked document does not exist
-5 Could not write the linked document
-6 The given accountno does not match the existing one
270
Integrating With GoldMine
271
Integrating With GoldMine
Name Description
OnTime Time of activity (Required for scheduling recurring activities when using
gm6s32.dll – GoldMine 6.0)
Duration Duration of activity
Alarm If set to 1, an alarm will set for the specified user. Default is 0.
AlarmDate Date of alarm. Must set Alarm to 1 to use.
AlarmTime Time of alarm. Must set Alarm to 1 to use.
RSVP If set to 1, the activity will be sent with an RSVP. Default is 0.
Private If set to 1, the activity will be marked as private. Default is 0.
Notify If set to 1, the scheduled user will receive a notification. Default is 0.
Amount Sale amount. Only used when RecType = S
ProbSale Probability of sale. Only used when RecType = S
UnitsSale Number of units in sale. Only used when RecType = S
ccUsers List of additional users to schedule the activity for
bccUsers List of users to inform about the activity througha GoldMine e-mail.
Resources List of resources to reserve for this activity.
RecurType Use only for versions of GoldMine earlier than 6.0. For recurring activities.
Specify one of the following to indicate how the activity should be repeated:
Value Description
1070 Daily
1071 Weekly
1072 Bi-weekly
1073 Monthly
1074 Quarterly
1075 Yearly
1076 Every n days. Also use RecurNDays nv
pair.
1080 First. Also use RecurOnDays nv pair. Ex.
Schedule on the first Monday of every
month.
1081 Second. Also use RecurOnDays nv pair.
1082 Third. Also use RecurOnDays nv pair.
1083 Fourth. Also use RecurOnDays nv pair.
1084 Last. Also use RecurOnDays nv pair.
RecurNDays Use only for versions of GoldMine earlier than 6.0. Recur every x days.
Used when RecurType is set to 1076.
272
Integrating With GoldMine
Name Description
RecurOnDay Use only for versions of GoldMine earlier than 6.0.
Used when RecurType is set to 1080-1084. For example, you wish the
activity to be schedule for the first Monday of every month, then RecurType
would be set to 1080 and RecurOnDay would be set to 1092.
Value Description
1091 Sunday
1092 Monday
1093 Tuesday
1094 Wednesday
1095 Thursday
1096 Friday
1097 Saturday
RecurSkipWeekend Use only for versions of GoldMine earlier than 6.0.
Set to 1 (default) if the activities should not be scheduled on weekends,
should the scheduling pattern call for it to land on one. Otherwise 0.
RecurFromDate Use only for versions of GoldMine earlier than 6.0.
The date to begin scheduling the activities.
RecurToDate Use only for versions of GoldMine earlier than 6.0.
The date to end the scheduled activities.
273
Integrating With GoldMine
Name Description
RecurInterval Represents how often the recurrence rule repeats
RecurOnDay The day(s) when the recurrence occurs:
The following seven values can be used when RecurType equals 3
through 5. The values can be combined using the bitwise AND operator.
Value Description
1 Sunday
2 Monday
4 Tuesday
8 Wednesday
16 Thursday
32 Friday
64 Saturday
The following values should only be used when RecurType is equal to
monthly (4) or yearly (5).
Value Description
200 Weekday
201 Weekend Day
202 Day
RecurMonthDay The day of the month the activity should occur. Values 1 through 31 are
valid. Should only be used if RecurType is monthly (4) or yearly (5). If
RecurMonthDay is used, then RecurPos is ignored.
RecurPos Specifies if the activity should be scheduled on the first, second, third,
fourth or fifth day specified in RecurOnDay (as in, first Monday of each
month, etc). Used only when RecurType is monthly (4) or yearly (5). If
RecurMonthDay is set also, this value will be ignored.
RecurMonth Specifies which month the recurring activity is to be scheduled in when the
RecurType is set to monthly (5). Valid values are 1 through 12 and
correspond to months respectively (1 = January).
RecurSkipWeekend Skip weekends when scheduling recurring activities. Valid values or 1
(default) or 0. Use when RecurType is daily (2), monthly (4), or yearly (5).
RecurSkipNon Skip hours that are not designated as part of the workday (ex: 5pm through
WorkdayHours 8 am). Valid values are 1 (default) or 0. Use when RecurType is set to
hourly (1).
ERROR CODES
These WriteSchedule error codes were added in GoldMine API Version: 6.0.21021
WriteSchedule Error Codes
Name Description
1 Success
0 General Failure
-10 Ondate > RecurEndDate
-11 No Ondate specified
274
Integrating With GoldMine
Name Description
275
Integrating With GoldMine
Name Description
Link If Set to 1 indicates that it is linked to the contact record specified in AccountNo.
Amount Sales amount. Used where RecType = S
ProbSale Probability of sale. Used where RecType = S
UnitsSale Number of units in sale. Used where RecType = S
276
Integrating With GoldMine
Name Description
Notes Notes on a given resolution - see htmlnotes and appendnodes
ResolutionType A user defined resolution code - alpha numeric 40 chars
ResolutionNotes Notes on the resolution - See htmlnotes and appendnotes
DueDate The date that resolution is due. The format must be date then time in your locale's
format (3-16-07 10:00 am)
ResolvedBy The goldmine user that resolves the issue
ResolvedDate The date of actual resolution. The format must be date then time in your locale's
format (3-16-07 10:00 am)
HTMLNotes Boolean that determines if the notes passed are pre formatted for HTML. 1= true,
0 = false, default is 0
AppendNotes Boolean that determines if notes are overwritten or a new note is appended to the
end. 1= append, 0 = overwrite. Default is 1
ERROR CODES
277
Integrating With GoldMine
ERROR CODES
WriteCaseTeamLink NV Pairs
Name Description
CaseID A valid Case table recid to add the user. Required for updates.
UserName The GoldMine User Name to add to the Case Team
Role The role for the user. User defined alpha numeric 40 chars.
278
Integrating With GoldMine
ERROR CODES
Required NV Pairs
Name Description
AccountNo AccountNo of the contact record (Contact1) to which to attach the track.
Track
UserID
279
Integrating With GoldMine
280
Integrating With GoldMine
CreateContactGroupOptional NV Pairs
Name Description
GroupCode Group code.
UserName Group owner. The currently logged in user will be used if empty.
SyncGroup 1 (default) if the group should be synced. Otherwise 0.
RETURN CODES
281
Integrating With GoldMine
Members NV Pairs
Name Description
RETURN CODES
Note that on the first instance the function encounters an error adding a member, it
will stop adding members and not continue through the list of requested members.
AddContactGrpMembers Return Codes
Code Description
1 Success
0 General Failure
-1 Missing Group Number
-2 Unable to find group
-3 Cannot add member
-4 No members added
Using AddContactGrpMembers
Below are the steps you should take in order to populate the Members Name/Value
pair correctly.
1. Create parent container using GMW_NV_Create.
2. Populate GroupNo Name/Value pair in parent container.
3. Create another container using GMW_NV_Create to serve as the child
container (assign to a different long variable).
282
Integrating With GoldMine
Reading a Record
ReadRecord reads a record from the specified table, based on RecID. When the
TableName=Contact1, all Contact2 fields will also be returned. Any record that is
inaccessible through GoldMine due to record curtaining will not be returned. Any
fields inaccessible through GoldMine due to field-level access restrictions will not be
returned.
SPECIAL NVS
AccountNo can be used to find the record instead of RecID if TableName=Contact1.
283
Integrating With GoldMine
Name Description
CurtainingState Indicates level of curtaining for returned record. 0 – none, 1 – partial, 2- full. Use
this to save a call to IsContactCurtained.
RETURN CODES
SPECIAL NVS
AccountNo can be used to find the record instead of RecID if TableName=Contact1.
284
Integrating With GoldMine
RETURN CODES
RecID RecID of the Contact1 record to return. You can optionally use AccountNo.
AccountNo AccountNo of the Contact1 record. You may optionally use RecID.
RETURN CODES
285
Integrating With GoldMine
Code Description
>0 The number of alerts returned.
Attaching an Alert
SetContactAlert attaches an alert to the specified contact record. To generate an alert
list, execute the GetAllAlerts function.
RecID RecID of the Contact1 record to which to attach this alert. You can optionally use
AccountNo.
AccountNo AccountNo of the Contact1 record. You can optionally use RecID.
Code Three-character Alert Code.
Creator Creator of the Alert.
SaveHist A history record is generated each time the Alert is acknowledged if set to 1.
286
Integrating With GoldMine
287
Integrating With GoldMine
Name Description
UserGroupsList Comma-delimited list of user group numbers of which the user is a member
UseGroupsCount Number of users in the list
The GMW_Execute function will return the same value as UserGroupsCount.
GroupNo User group number. For details on retrieving a UserGroupList name and number,
see the GetUsersList or GetUserMemberships functions.
UserList Comma-separated list of users who are members of the specified group.
288
Integrating With GoldMine
GetGroupNameRequired NV Pairs
Name Description
GroupList Comma-delimited list of group number for which to retrieve names (for example:
1,4,5,8)
GetGroupNameReturn NV Pairs
Name Description
EXAMPLE
GroupCount = 4
1 = MyGroup
2 = Techs
3 = Sales
4 = Management
NAME/VALUE PAIRS
XbaseContactExprNV Pairs
Name Description
AccountNo Account number of the contact to parse against
XbaseExpr Expression to parse, or
ExprCount Number of expressions to parse, and
XBaseExpr1 .. Expressions to parse
XBaseExprN
289
Integrating With GoldMine
RETURN VALUES
The XbaseContactExpr function returns the following status values:
XbaseContractExpr return values
Value Description
-2 Contact was not found
-1 No accountno given
0 No expression
1..N Number of correctly parsed expressions
Encrypting Text
The EncryptString function encrypts a plain text string to a Base64 ASCII encoded
buffer.
EncryptStringReturned NV Pairs
Name Description
CryptText Encrypted string in an ASCII encoded buffer (Base 64).
290
Integrating With GoldMine
DecryptStringRequired NV Pairs
Name Description
Key Key to use. Must be the same as when encrypting.
CryptText Text to decrypt.
HashKey Set to “1” to specify the key to be hashed before use. Provides better security if the
key is very simple.
291
Integrating With GoldMine
RETURN VALUES
Value Description
0 OK
-1 Empty or bad RecID value
-2 Can’t open database
-3 Cal record not found
-4 Failed to delete
-9999 General exception (unknown error)
RETURN VALUES
Value Description
0 OK
-1 Empty or bad RecID value
-2 Can’t open database
-3 ContHist record not found
-4 Failed to delete
-9999 General exception (unknown error)
292
Integrating With GoldMine
NAME/VALUE PAIRS
WriteGMUser NV Pairs
Name Description
UserName Username to add
Password Password for the user
FullName Full name of the user
SQLUser SQL login to be used for this user if connecting to an MS SQL database
SQLPassword Password for the SQL login
MasterUser Set to “1” to enable master rights for this user, otherwise “0”
RETURN VALUES
WriteGMUser returns “1” on success and “0” on failure.
ReadGMUserNV Pairs
Name Description
UserName Username to add.
Password Password for the user
FullName Full name of the user
SQLUser SQL login to be used for this user if connecting to an MS SQL database
SQLPassword Password for the SQL login
MasterUser “1” if this is a master rights user, otherwise “0”
293
Integrating With GoldMine
RETURN VALUES
ReadGMUser returns “1” on success and “0” on failure.
294
Integrating With GoldMine
Name Description
UsersREPORTS The user group’s reports that this user has permission to view. Valid if
permission is set. See AccessRights name/value pair.
UsersFILTERS The user group’s filters that this user has permission to view. Valid if
permission is set. See AccessRights name/value pair.
UsersFORMS The user group’s forms that this user has permission to view. Valid if
permission is set. See AccessRights name/value pair.
UsersSALES The user group’s sales that this user has permission to view. Valid if
permission is set. See AccessRights name/value pair.
ForceLogoutAt The time (AM/PM) that this user will be forced to exit GM.
IdleLogout The amount of time (in minutes) that GM will remain idle before shutting
down.
MenuExclusion A string containing the menu ID's that are excluded from the user's instance
of GM, delimited by an underscore. Ex. "344_531_164_"
NewRecOwnership A Boolean value that states whether or not new users are automatically
assigned to this user.
FieldAccessRightsOutput NV Pairs
Name Description
**TotalFieldCount** Number of fields returned
Field Names Possible values:
(for example, COMPANY, CONTACT, KEY1) N - No Access
R - Read Access
W - Read/Write Access
295
Integrating With GoldMine
Note: You must pass an empty NV container with all calls that do not take any parameters.
NAME/VALUE PAIRS
296
Integrating With GoldMine
1 OK
0 General Error
-1 No Username
-2 User already undocked
-3 Cannot open user file
-4 User not found
-5 Undocked license count exceeded
-8 Cannot create the new license file
NAME/VALUE PAIRS
RemoveRemoteLicense NV Pairs
Name Description
UserName User Name or Site Name
LicType U (undocked) or S (sublicense site)
297
Integrating With GoldMine
Output NV Pairs
Name Description
RecID Cal/History RecID
MboxRecID Mailbox RecID
MailboxFlags Collection of flags:
MAILBOX_ITEM_READ 0x0001
MAILBOX_ITEM_HIST 0x0002
MAILBOX_ITEM_OUTBOUND 0x0004
MAILBOX_ITEM_ATTACH 0x0008
MAILBOX_ITEM_REDIRECT 0x0010
MAILBOX_ITEM_GMASLINKS 0x0020
To List of all the To: recipients. Comma-delimited and quoted if needed.
Cc List of all the CC: recipients. Comma-delimited and quoted if needed.
Bcc List of all the Bcc recipients. Comma-delimited and quoted if needed.
ReplyTo Reply to address (if any)
From The from address of the message. Will usually be the default user account, but
can contain other addresses.
Subject Subject
Org Organization that will appear in the header.
MessageID MessageID from the header.
Status Message status from the header.
Date Internet standard date from the header.
XMailer XMailer from the header.
OtherHeaders Other headers not categorized above.
Body Message body. This will be different in edit mode.
Attachments A question mark delimited list of attachments.
298
Integrating With GoldMine
Name Description
Alarm 1 if set, 0 if not.
History 1 if from History, 0 if not.
Private 1 if private, 0 if not.
RSVP 1 if marked for RSVP, 0 if not.
ReturnReceipt 1 if requested, 0 if not.
Encrypted 1 if the message is encrypted, 0 if not.
Outgoing Message is an outgoing message (queued for delivery or already sent): 1 or 0.
MailType Following types are possible:
SMM_Internet 0 This is the one to handle
SMM_GoldMine 1 Only exists for compatibility with GoldMine 4.0
SMM_Template 2 Template mails.
IsMIME 1 if MIME based message, 0 if not.
AccountNo Accountno of the linked contact (or empty).
LinkedContact If an additional contact is linked this will have the ContSupp RecID.
LinkedOppty RecID of the linked opportunity or project (if applicable).
Activity Activity Code
Result Result Code
CalDate Calendar/History date
CalTime Calendar/History time
Contact Contact name
CreateBy User who created the mail or “Internet” if the message was retrieved from the
mail server.
Folder Folder in which the message is stored.
SubFolder Subfolder in which the message is stored. No value will be returned if the
message(s) already exist in the Inbox or Outbox.
RecType RecType of the Calendar record:
In Cal: Q = Queued mail, M = Incoming
In History: MI = Incoming, MO = Outgoing
Reference Calendar/History reference. Usually initialized from the subject automatically.
User User who owns the message belongs.
HasTransferSet 1 if the e-mail message has a transfer set attached to it, 0 if not.
HasVCard 1 if the e-mail message has a Vcard attached to it, 0 if not.
HasWebImport 1 if the e-mail message has a WebImport attached, 0 if not.
299
Integrating With GoldMine
RETURN CODES
300
Integrating With GoldMine
Name Description
Attachment0..AttachmentN Indexed list of attachments. The first attachment NV pair will be
Attachment0, then Attachment2, and so on.
MailboxFlags See ReadMail
AccountNo Accountno of the contact to which the message is linked
OpptyRecID RecID of an opportunity or project to which the message should be
linked
LinkedContact RecID of the contsupp record of an additional contact, if so linked
ActivityCode Activity code
CalDate Calendar date – the date to actually send the message
CalTime Calendar time – the time to actually send the message
Reference Reference in the calendar record
Result Result code
User User name
Private 1 to mark as Private, 0 if not
RSVP 1 to request a RSVP, 0 if not
Alarm 1 set alarm, 0 if not
ReturnReceipt Request a return receipt. The value portion of the pair should be the
return address to which to send the receipt.
SaveAsDraft Set to 1 if the message should be saved as a draft and not queued.
UseMIME Set to 1 to force the message to be a MIME message even if no
attachments are available, otherwise 0.
AttachVCard Set to 1 to attach the user Vcard to the message, otherwise 0
SendNow Set to “1” to send the message immediately without queuing it. Pertains
to a GoldMine user only (no Internet recipients).
Password Specify a password to set this message to be encrypted. See also the
EncryptUSMode name/value pair.
EncryptUSMode Set to “1” and specify a password to use the US encryption mode. This
will be forced to “0” if the license does not allow it.
301
Integrating With GoldMine
302
Integrating With GoldMine
Name Description
SubFolder The name of the subfolder in which to put the mail. Folder must also be defined.
To put it in a sub-inbox, set Folder to “X-GM-INBOX”
RETURN CODES
The SaveMail function returns the following values:
SaveMail Return Codes
Value Description
0 Cannot initialize
-1 Cannot queue the message
-2 Can’t save the message (for incoming e-mail)
-3 Can’t complete the message to the requested folder
-4 An existing message was loaded. SaveMail works only with new messages.
Deleting a Message
The DeleteMail function deletes a message according to the settings specified for the
user within GoldMine (use trashcan or not, delete attachments or not). A message
can be deleted based on either the Mailbox RecID or the Calendar/History RecID
with a flag to tell the function if it should look in the Calendar or History table.
DeleteMailRequired NV Pairs
Name Description
MboxRecID Mailbox RecID for the record to be deleted, or
RecID Calendar/History RecID
History 1 if the RecID in the RecID NV pair is from the History table, or 0 if from the
Calendar table
303
Integrating With GoldMine
RETURN CODES
PrepareNewMailOptional NV Pairs
Name Description
LinkToAccount AccountNo of the contact to link the new message to.
LinkToAddContact RecID of the additional contact record to link to. LinkToAccount must also be
specified.
ManualTo Specific e-mail address to send to.
MailType Pass a 1 to indicate creation of an internal GoldMine mail message.
304
Integrating With GoldMine
PrepareReplyMailOptional NV Pairs
Name Description
LinkToAccount AccountNo of the contact to whom to link the new message.
LinkToAddContact RecID of the additional contact record to link to LinkToAccount must also be
specified.
305
Integrating With GoldMine
NAME/VALUE PAIRS
AddFolder NV Pairs
Name Description
Folder Folder name to be created—Required
SubFolder Optional subfolder name
User Optional user name. Defaults to the logged-in user
306
Integrating With GoldMine
NAME/VALUE PAIRS
DeleteFolder NV Pairs
Name Description
Folder Folder name—Required
Subfolder Optional subfolder name.
FromList
The FromList function returns a list of unique From addresses to use in outgoing e-
mail.
307
Integrating With GoldMine
308
Integrating With GoldMine
Name Description
DefaultAccountID Default account number
Indexed Name/Value Pairs:
AccountID ID needed by the other e-mail account-related functions (for example,
OnlineList)
DisplayName Name of the e-mail account displayed in the E-mail Center. If available,
the account name is used, and if the user requests that
mailto:user@server will always be shown, then they’re appended to the
account name.
User User to whom the profile is assigned (same as the logged-in user)
AccountName User-defined descriptive name given to the e-mail account
POP3Server Address of the POP3 server
Username Username for the POP3 server
Password Password for the POP3 account
OwnUser User who owns the account. This is used so one user can retrieve e-mail
for another user. The result is that e-mail messages retrieved by JOHN but
with OwnUser set to MARY, will appear in MARY’s e-mail center, not
in JOHN’s.
POPAuthMode POP server’s authentication mode. Possible values:
0 – PASS
1 – APOP
2 – RPA
3 – NTLM
DeleteMail Set to “1” to auto-delete mail from this account, otherwise “0”
AutoRetrieve Set to “1” to auto-retrieve messages from this account, otherwise “0”
UseSigFile Set to “1” to use a signature file with this account, otherwise, “0”
SigFile Path and filename to the signature file if UseSigFile is set
POPPort POP3 Server’s port number
TOPSupport Set to 1 if the account supports the TOP command
ShowInIMC Set to “1” to show this account in the Internet Mail Center
SMTPServer SMTP Server address
ReturnAddress Return e-mail address for this account
SMTPPort Port number for the SMTP server
SMTPUser Username for the SMTP server, if the server requires authentication.
SMTPPass Password for the SMTP server, if the server requires authentication
SMTPAUTH Set to “1” if the SMTP server requires authentication
SMTPAUTHMode Possible Values:
0 – None
1 – Login
2 - NTLM
309
Integrating With GoldMine
310
Integrating With GoldMine
Name Description
Message_GMUsersTo Comma-delimited list of GoldMine users to whom the message is being
sent.
Message_GMUsersCc List of GoldMine users to whom the message is being copied.
Message_Org E-mail organization field.
Message_OtherHeaders Other headers associated with this message.
Message_Read 1 if the message has already been read, otherwise 0.
Message_Headers Formatted headers as they appear in the preview window.
Message_Body Message body (according to the number of lines previewed in the E-mail
Center).
RETURN VALUES
Retrieving Messages
The RetrieveMessages function retrieves specified messages that are online. The
returned name/value pairs will have a message number appended to the end of the
name.
311
Integrating With GoldMine
Name Description
Message_MboxRec Mailbox RecID of the message, ***** if an error occurred.
RETURN VALUES
RETURN VALUES
312
Integrating With GoldMine
Value Description
0 General Failure
-1 Invalid Account ID
-2 Protocol Error—see the error description in error
-3 Comm error—see the error description in error
-4 Timeout or other error—see the error description in error
-5 Unknown error
313
Integrating With GoldMine
Name Description
MultiActive 1 – Show all accounts in the mail center
0 – Show only the default account
PreviewLines Number of lines to preview in the E-Mail Center prior to downloading the
message
QuoteAll 1 to quote entire message by default when replying, otherwise 0
NewQuoteStyle 1 to specify a custom quote string identifier, otherwise 0
QuoteString Quote string identifier to be used if NewQuoteStyle is set. Ex: >>
Organization User-specified signature .txt file
UseOrg 1 to include the signature specified in Organization
SaveHistDefault 1 – Save filed mail in history by default
0 – Do not
AttachDir Folder in which to save attachments.
OnlyGMMail 1 – When auto retrieving, retrieve only mail from other GoldMine clients.
0 – Auto retrieve mail from all clients
SkipLarge If automatic retrieval is set, set to 1 to skip large e-mail message larger
than size specified in MaxEmailSize, otherwise 0
MaxEmailSize Limit on size of messages to be automatically retrieved if SkipLarge is set
to 1
SkipNoAddress 1 indicates to not skip addresses not on file, otherwise 0
WarnAboutRTF 1 – warn user before sending HTML mail
0 – Do not
GetUnreadMail If automatic retrieval is set, set to 1 to retrieve only unread mail, otherwise
0
UseHeaderDate 1 to use the date in the mail header, otherwise 0
CompleteOnReply 1 to complete the original message being replied to, otherwise 0
UUEncodeScan 1 to scan mail for UUEncoded Data, otherwise 0
VcardAction 100 if incoming Vcards are not to be saved
Use8BitEncoding 1 to use 8 bit encoding, otherwise 0
AutoSpell 1 to automatically spell check messages before sending, otherwise 0
ForceWrapAt When forcing line wrap, wrap at this specified column number
WrapReplyAt Wrap quoted lines in reply at this specified column number
LoadPublicTemplates 1 to show public e-mail templates, otherwise 0
ReadOnGet 1 to Open ‘Read E-mail’ dialog on retrieval, otherwise 0
LinkOnGet 1 – Prompt user if incoming e-mail address is not on file
0 – Do not
SkipOnDispose 1 – Go to next message in reader after disposing of (deleting/filing) the
current one
0 – Close the reader
314
Integrating With GoldMine
Name Description
ShowHeaders Settings for the mail center preview window headers display:
0 – no headers
1 – summary of headers only
2 – full headers display
UseTrashCan 1 to use trash can for deleted mail, otherwise 0.
EmptyTrashOnExit 1 to empty trash when closing E-Mail Center, otherwise 0.
ConfirmEmptyTrash 1 to confirm before deleting from trash can, otherwise 0.
ShowFullAccountName 1 to show both the e-mail address and the account name (if available) for
online accounts, otherwise 0.
DiscardWebImportMess 1 to discard Web import message after the data has been imported,
ages otherwise 0.
AutoWebImport 1 to import data when retrieving E-Mail Center mail, otherwise 0 (setting
this to 0 does NOT assume BackgroundWebImp).
BackgroundWebImp 1 to import data on background e-mail retrieval, otherwise 0 (setting this
to 0 does NOT assume AutoWebImport).
SyncContact Sticky setting from the E-mail Center to move the current contact record
to the one the selected message belongs to. Set to 1 to activate, 0
otherwise.
KeepOldTransfers 1 to keep the transfer set attachments after retrieving them, otherwise 0.
AllowDeleteAll 1 to enable ‘Delete All Server Mail’, otherwise 0.
SendVCard 1 to use user-supplied V-card, otherwise 0.
DefaultLinkAddr When linking an incoming e-mail in GoldMine, if the
e-mail does not exist within GoldMine, a dialog box appears to the user.
There is a checkbox indicating whether to keep the setting of how the
unlinked message is handled. To keep the setting, set this NV pair to 1,
otherwise 0.
SyncAttachmentDefault 1 to mark attachments for syncing by default, otherwise 0.
ShowOutlookInIMC 1 to show the Outlook folder in the E-Mail Center, otherwise 0.
LinkAttachToCont 1 to save attachments as linked documents, otherwise 0.
MarkIncomingAsPrivate 1 to mark incoming messages as private, otherwise 0.
DelAttachWithMsg 1 to delete attachments when deleting the mail, otherwise 0.
KeepUserVCard Every time GoldMine is restarted and a message is sent, GoldMine
creates a VCard for the sending user so that a correct VCard for the user
can be sent with the mail if so requested. The VCard is created from
information GoldMine has for the logged-in user. Sometimes a user may
want to manually edit the VCard to add or change information not
available to GoldMine. In this case, the user can ask GoldMine to not
recreate the VCard from scratch and GoldMine will use the existing
VCard that the user modified. Set to 1 to have GoldMine not create a
new VCard, otherwise 0.
BccToSelf 1 to always send a Bcc to the user, otherwise 0.
UseShortDate 1 to use the short date format, 0 to use the long format.
GMAttachAsLinks 1 to send attachments as links to GoldMine users, otherwise 0.
315
Integrating With GoldMine
Name Description
POPIdleDisconnect Number of minutes to wait without activity only in the E-mail Center
before automatically disconnecting. The default is 10 minutes.
SkipOverWriteUI 1 to suppress file overwrite prompt, otherwise 0.
RetrieveOverwrite Default action to be taken when an e-mail attachment file already exists.
Possible values:
4 – auto name assignment
5 – do not save the file
6 – overwrite existing file
7 – new file name
DefaultOUTFolder Folder name under which to put sent mail (replace the default sent
folder).
DefaultINFolder Folder name under which to put filed mail instead of the default Filed
folder.
MonthlyFolderNames List of folder names to replace the standard month names used in
GoldMine by default. Each month must be * separated and the last entry
must be ???*
NewFilingMode 1 to indicate to use two-level filing mode
(GoldMine 6.0 and
greater ONLY)
ActiveAutoGetMail 1 to activate automatic mail retrieval, otherwise 0.
GetInterval Frequency in minutes to check for mail automatically, if
ActiveAutoGetMail is set.
SendQueueWhen 1 to send queued messages when ActiveAutoGetmail is set, otherwise 0.
AutoGet
GetOldToNew 1 to download old messages first, otherwise 0.
UseHTMLByDefault 1 to use HTML when creating new e-mail, otherwise 0.
ExtractEmbedded 1 to extract embedded HTML as attachment, otherwise 0.
HTML
TCPTimeout Number of seconds until a communication timeout.
SendQueueFor A semicolon-delimited list of GoldMine user names for which this account
should send queued e-mail.
FakeSMTPDomain Used to present the system as a user-defined name if the name returned
by the system is not acceptable by the SMTP server.
DefaultTemplate Specify the default template name for new outgoing messages.
DefaultReplyTemplate Specify the default template name for new reply messages.
DefaultFwdTemplate Specify the default template name for new forwarded messages.
Quarantine-to Name of the quarantine directory to which the quarantine rules move
files.
In addition, each e-mail account set up for the user is supplied or returned through a
special multi-value item named Profiles. The Profiles NV pair contains a set of
containers; each holds information for a different e-mail account. You can determine
the number of accounts by calling the GMW_NV_GetMultiValueCount function.
316
Integrating With GoldMine
To retrieve the HGMNV pointers for the child containers, call GMW-NV-
GetMultiNvValue for each account to retrieve.
If you are setting e-mail preferences, you will want to set the NV values for an
e-mail account by using either:
• GMW_NV_AppendNvValue, to copy a prepared container to the Profiles
NV pair or
• GMW_NV_AppendEmptyNvValue, to create an empty child container
within the Profiles NV Pair for which you can later set the values.
See “Working with Multi-Value Name/Value Pairs” on page 106 for more
information on these functions.
Profiles child containers have the following NV Pairs.
Profiles Child Container NV Pairs
Name Description
POP3_Account The user-editable descriptive name for the account
POP3_Server The server name or address
POP3_User The server user name
POP3_Pass The password for the account
Return_Address The return address
SMTP_Server The SMTP server name or address
SigFile The path to the signature file to use
OwnUser The user to which this account belongs. This is used so one user can retrieve e-
mail for another user. The result is that e-mails retrieved by JOHN but with
OwnUser set to MARY will appear in MARY’s e-mail center, not in JOHN’s.
DelServerMail Set to 1 to delete the messages from the server upon retrieval, otherwise 0
AutoGetMail Set to 1 to automatically retrieve mail for this account.
UseSigFile Set to 1 to use the specified signature file
ShowInIMC Set to 1 to show this account in the E-mail Center.
UseTOPCmd Set to 1 if this server supports the TOP command, otherwise 0
POP3_Port The POP3 server’s port number
SMTP_Port The SMTP server’s port number
POP3_AuthMode The POP server’s authentication mode. Possible values:
0 – PASS
1 – APOP
2 – RPA
SMTP_AuthMode Possible values:
0 – None
1 – Login
2 – NTLM
SMTP_User The username for the SMTP server, if the server requires authentication
SMTP_Pass The password for the SMTP server, if the server requires authentication
317
Integrating With GoldMine
NOTES
This function is useful when writing an extranet solution for GoldMine. To enable
GUI access to these features, set ContWebAccess=1 under the [GoldMine] section of
your username.ini. You can then select Edit|Record Properties|WebAccess to set the
Web user/pass (maximum of 15 characters each). GoldMine stores Web access data
in ContSupp with a RecType of W. Each user name and password must be unique.
This information does not synchronize.
318
Integrating With GoldMine
an NV pair named “Field”. This NV pair will contain an entire NV pair container for
each field defined on that view, each with its own set of NV pairs describing that
field. For information on how to read and manipulate multi-container NV pairs,
please see Working with Multi-Value Name/Value Pairs on page 93.
Important Note: The GoldMine user logged into the API must have master rights in
order to use these functions.
319
Integrating With GoldMine
320
Integrating With GoldMine
Value Description
-2 Field views cannot be loaded
321
Integrating With GoldMine
Name Description
UserAccess The user that is allowed to access this view.
CurrContactset If set to 1, then the view is visible in the current contact set, otherwise the value is
0
Field A multi-value list containing a container for each of the field operations to perform
(adding, deleting, modifying). See the table below for details of the NV containers
to include.
322
Integrating With GoldMine
API could not add, an entry is added to the field’s child container in an NV pair
called Error. The possible values for this pair are:
Field Error Codes
Value Description
-1 Invalid Action
-2 Requested field not found
-3 No Record ID given for updating or deleting a field
-4 Field cannot be deleted
-5 Field cannot be written
-6 For a new view, only new fields are possible (Action cannot equal MODIFY or DELETE if
creating a new view).
-7 Reserved
-8 Reserved
-9 Reserved
-10 -> -20 Invalid positioning
323
Integrating With GoldMine
324
Integrating With GoldMine
325
Integrating With GoldMine
Name Description
ShowMsg Show msgs on the cal
ShowOccasion Show occasions on the cal
ShowOpTask Show opportunity tasks on the cal
ShowOther Show other events on the cal
ShowProjTask Show project tasks on the cal
ShowPubEvent Show public events on the cal
ShowSales Show sales on the cal
ShowToDo Show to do's on the cal
ShowHistAction Show history actions on the cal
ShowHistCall Show call actions
ShowHistEvent Show event actions
ShowHistLitReq Show lit req actions
ShowHistMsg Show msg actions
ShowHistOpTask Show op task actions
ShowHistOther Show other actions
ShowHistProjTask Show proj task actions
ShowHistPubEvent Show pub event actions
ShowHistSales Show sales actions
ShowHistToDo Show todo actions
DefaultView The default view of the calendar
0 - day
1 - week
2 - month
3 - year
4 - planner
5 - outline
6 - pegboard
AutoForwardCalls Automatically forward calls
AutoForwardMsgs Automatically forward messages
AutoForwardActions Automatically forward actions
AutoForwardAppts Automatically forward appointments
AutoForwardSales Automatically forward sales
AutoForwardOther Automatically forward other
SyncRecord Sync the record
ShowTotals Show totals
ShowIcons Show icons
RefreshRate In seconds
PegRefreshRate Pegboard refresh rate in secs
326
Integrating With GoldMine
Name Description
Color The windows color value for the cal color
TimeIncrement In minutes
FontSize Calendar font size
ShowWeekends Show weekends
FirstDayofWeek 0 = Sunday 7 = sat
nWeekends Bit mathed for days to consider the weekend
DayBegin Military time for the day beginning. 09:00
DayEnd Day end in military time - 17:00 for 5pm
CalShowActvCode Show activity code on cal
HistShowActvCode Show hist activity code
PublishICal Publish iCal file?
PublishICalPath The path to where to publish ical - must be in URI format (must
start with file:, http:, or ftp:)
PublishICalUser If path is ftp or http, the login user name
PublishICalPwd If path is ftp or http, the login user pwd
PublishICalUsersList The users to publish
PublishIcalAction Publish actions
PublishIcalAppt Publish appointments
PublishIcalCall Publish calls
PublishIcalEvent Publish events
PublishIcalLitReq Publish literature requests
PublishIcalMsg Publish msgs
PublishIcalOccasion Publish occasions
PublishIcalOpTask Publish opportunity tasks
PublishIcalOther Publish other events
PublishIcalProjTask Publish project tasks
PublishIcalPubEvent Publish public events
PublishIcalSales Publish sales
PublishIcalToDo Publish to do's
PublishIcalHistAction Publish history actions
PublishIcalHistCall Publish call
PublishIcalHistEvent Publish event
PublishIcalHistLitReq Publish literature request
PublishIcalHistMsg Publish message
PublishIcalHistOpTask Publish op task
PublishIcalHistOther Publish other
327
Integrating With GoldMine
Name Description
PublishIcalHistProjTask Publish project task
PublishIcalHistPubEvent publish public event
PublishIcalHistSales Publish sales
PublishIcalHistToDo Publish todo
Publish2ICSFilterByDate Dates to publish
Publish2ICSStartDate The start date of the range
Publish2ICSEndDate The end date of the range
PublishICSFilterActivCode The activity code to filter on
PublishICSFilterRef The reference code to filter on
PublishICSFilterByLink Filter on the link? true or false
PublishHTML Publish cal to HTML?
PublishHTMLPath The path to where to publish the HTML - must be in URI format
(must start with file:, http:, or ftp:)
PublishHTMLUser If path is ftp or http, the login user name
PublishHTMLPwd If path is ftp or http, the login user pwd
PublishHTMLUsersList The users to publish
PublishHTMLAction Publish actions
PublishHTMLAppt Publish appointments
PublishHTMLCall Publish calls
PublishHTMLEvent Publish events
PublishHTMLLitReq Publish literature requests
PublishHTMLMsg Publish msgs
PublishHTMLOccasion Publish occasions
PublishHTMLOpTask Publish opportunity tasks
PublishHTMLOther Publish other events
PublishHTMLProjTask Publish project tasks
PublishHTMLPubEvent Publish public events
PublishHTMLSales Publish sales
PublishHTMLToDo Publish to do's
PublishHTMLHistAction Publish history actions
PublishHTMLHistCall Publish call
PublishHTMLHistEvent Publish event
PublishHTMLHistLitReq Publish literature request
PublishHTMLHistMsg Publish message
PublishHTMLHistOpTask Publish op task
PublishHTMLHistOther Publish other
328
Integrating With GoldMine
Name Description
PublishHTMLHistProjTask Publish project task
PublishHTMLHistPubEvent Publish public event
PublishHTMLHistSales Publish sales
PublishHTMLHistToDo Publish todo
Publish2HTMFilterByDate Dates to publish
0 - today
1 - yesterday
2 - tomorrow
3 - this week
4 - last week
5 - next week
6 this month
7 last month
8 next month
9 - this year
10 - next year
11 - date range
Publish2HTMStartDate the start date of the range
Publish2HTMEndDate the end date of the range
PublishHTMFilterActivCode the activity code to filter on
PublishHTMFilterRef the reference code to filter on
PublishHTMFilterByLink Filter on the link? true or false
PublishFB publish free busy time if PublishFB is TRUE
PublishFBPath the path to where to publish free busy - must be in URI format
(must start with file:, http:, or ftp:)
PublishFBUser if path is ftp or http, the login user name
PublishFBPwd if path is ftp or http, the login user pwd
PublishFBAction Publish actions
PublishFBAppt Publish appointments
PublishFBCall Publish calls
PublishFBEvent Publish events
PublishFBLitReq Publish literature requests
PublishFBMsg Publish msgs
PublishFBOccasion Publish occasions
PublishFBOpTask Publish opportunity tasks
PublishFBOther Publish other events
PublishFBProjTask Publish project tasks
PublishFBPubEvent Publish public events
PublishFBSales Publish sales
PublishFBToDo Publish to do's
329
Integrating With GoldMine
Name Description
PublishFBHistAction Publish history actions
PublishFBHistCall Publish call
PublishFBHistEvent Publish event
PublishFBHistLitReq Publish literature request
PublishFBHistMsg Publish message
PublishFBHistOpTask Publish op task
PublishFBHistOther Publish other
PublishFBHistProjTask Publish project task
PublishFBHistPubEvent Publish public event
PublishFBHistSales Publish sales
PublishFBHistToDo Publish todo
PublishFBFilterByDate Dates to publish
0 - today
1 - yesterday
2 - tomorrow
3 - this week
4 - last week
5 - next week
6 this month
7 last month
8 next month
9 - this year
10 - next year
11 - date range
PublishFBStartDate The start date of the range
PublishFBEndDate The end date of the range
PublishFBFreq Frequency in minutes
330
Integrating With GoldMine
331
Integrating With GoldMine
Name Description
AutoForwardActions Automatically forward actions
AutoForwardAppts Automatically forward appointments
AutoForwardSales Automatically forward sales
AutoForwardOther Automatically forward other
SyncRecord Sync the record
ShowTotals Show totals
ShowIcons Show icons
RefreshRate In seconds
PegRefreshRate Pegboard refresh rate in secs
Color The windows color value for the cal color
TimeIncrement In minutes
FontSize Calendar font size
ShowWeekends Show weekends
FirstDayofWeek 0 = Sunday 7 = sat
nWeekends Bit mathed for days to consider the weekend
DayBegin Military time for the day beginning. 09:00
DayEnd Day end in military time - 17:00 for 5pm
CalShowActvCode Show activity code on cal
HistShowActvCode Show hist activity code
PublishICal Publish iCal file?
PublishICalPath The path to where to publish ical - must be in URI format (must
start with file:, http:, or ftp:)
PublishICalUser If path is ftp or http, the login user name
PublishICalPwd If path is ftp or http, the login user pwd
PublishICalUsersList The users to publish
PublishIcalAction Publish actions
PublishIcalAppt Publish appointments
PublishIcalCall Publish calls
PublishIcalEvent Publish events
PublishIcalLitReq Publish literature requests
PublishIcalMsg Publish msgs
PublishIcalOccasion Publish occasions
PublishIcalOpTask Publish opportunity tasks
PublishIcalOther Publish other events
PublishIcalProjTask Publish project tasks
PublishIcalPubEvent Publish public events
332
Integrating With GoldMine
Name Description
PublishIcalSales Publish sales
PublishIcalToDo Publish to do's
PublishIcalHistAction Publish history actions
PublishIcalHistCall Publish call
PublishIcalHistEvent Publish event
PublishIcalHistLitReq Publish literature request
PublishIcalHistMsg Publish message
PublishIcalHistOpTask Publish op task
PublishIcalHistOther Publish other
PublishIcalHistProjTask Publish project task
PublishIcalHistPubEvent Publish public event
PublishIcalHistSales Publish sales
PublishIcalHistToDo Publish todo
Publish2ICSFilterByDate Dates to publish
Publish2ICSStartDate The start date of the range
Publish2ICSEndDate The end date of the range
PublishICSFilterActivCode The activity code to filter on
PublishICSFilterRef The reference code to filter on
PublishICSFilterByLink Filter on the link? true or false
PublishHTML Publish cal to HTML?
PublishHTMLPath The path to where to publish the HTML - must be in URI format
(must start with file:, http:, or ftp:)
PublishHTMLUser If path is ftp or http, the login user name
PublishHTMLPwd If path is ftp or http, the login user pwd
PublishHTMLUsersList The users to publish
PublishHTMLAction Publish actions
PublishHTMLAppt Publish appointments
PublishHTMLCall Publish calls
PublishHTMLEvent Publish events
PublishHTMLLitReq Publish literature requests
PublishHTMLMsg Publish msgs
PublishHTMLOccasion Publish occasions
PublishHTMLOpTask Publish opportunity tasks
PublishHTMLOther Publish other events
PublishHTMLProjTask Publish project tasks
PublishHTMLPubEvent Publish public events
333
Integrating With GoldMine
Name Description
PublishHTMLSales Publish sales
PublishHTMLToDo Publish to do's
PublishHTMLHistAction Publish history actions
PublishHTMLHistCall Publish call
PublishHTMLHistEvent Publish event
PublishHTMLHistLitReq Publish literature request
PublishHTMLHistMsg Publish message
PublishHTMLHistOpTask Publish op task
PublishHTMLHistOther Publish other
PublishHTMLHistProjTask Publish project task
PublishHTMLHistPubEvent Publish public event
PublishHTMLHistSales Publish sales
PublishHTMLHistToDo Publish todo
Publish2HTMFilterByDate Dates to publish
0 - today
1 - yesterday
2 - tomorrow
3 - this week
4 - last week
5 - next week
6 this month
7 last month
8 next month
9 - this year
10 - next year
11 - date range
Publish2HTMStartDate The start date of the range
Publish2HTMEndDate The end date of the range
PublishHTMFilterActivCode The activity code to filter on
PublishHTMFilterRef The reference code to filter on
PublishHTMFilterByLink Filter on the link? true or false
PublishFB Publish free busy time if PublishFB is TRUE
PublishFBPath The path to where to publish free busy - must be in URI format
(must start with file:, http:, or ftp:)
PublishFBUser If path is ftp or http, the login user name
PublishFBPwd If path is ftp or http, the login user pwd
PublishFBAction Publish actions
PublishFBAppt Publish appointments
PublishFBCall Publish calls
PublishFBEvent Publish events
334
Integrating With GoldMine
Name Description
PublishFBLitReq Publish literature requests
PublishFBMsg Publish msgs
PublishFBOccasion Publish occasions
PublishFBOpTask Publish opportunity tasks
PublishFBOther Publish other events
PublishFBProjTask Publish project tasks
PublishFBPubEvent Publish public events
PublishFBSales Publish sales
PublishFBToDo Publish to do's
PublishFBHistAction Publish history actions
PublishFBHistCall Publish call
PublishFBHistEvent Publish event
PublishFBHistLitReq Publish literature request
PublishFBHistMsg Publish message
PublishFBHistOpTask Publish op task
PublishFBHistOther Publish other
PublishFBHistProjTask Publish project task
PublishFBHistPubEvent Publish public event
PublishFBHistSales Publish sales
PublishFBHistToDo Publish todo
PublishFBFilterByDate Dates to publish
0 - today
1 - yesterday
2 - tomorrow
3 - this week
4 - last week
5 - next week
6 this month
7 last month
8 next month
9 - this year
10 - next year
11 - date range
PublishFBStartDate The start date of the range
PublishFBEndDate The end date of the range
PublishFBFreq Frequency in minutes
335
Integrating With GoldMine
336
Integrating With GoldMine
337
Integrating With GoldMine
Name Description
DateFormat 0 = MMM d, yy
1 = MMMM dd, yyyy
2 = d MMM yy
3 = d. MMM yy
4 = dd MMMM yy
RightAlignNumbers Show numerics right-aligned
ShowSortByFieldInStatus Show sort-by field on status bar
ZipValidationMode 0= none, 1 primary, 2 show zip dialog
Show9DigitZip Show 5 or 9 digits in zip code lookup validation window
UseDarkBgd Use a dark background color on the RO
LargeFont Use a large font – doesn’t affect 640x480 resolution
LabelColor Windows color for the labels
DataColor Windows color for the data
338
Integrating With GoldMine
Name Description
RightAlignNumbers Show numerics right-aligned
ShowSortByFieldInStatus Show sort-by field on status bar
ZipValidationMode 0= none, 1 primary, 2 show zip dialog
Show9DigitZip Show 5 or 9 digits in zip code lookup validation window
UseDarkBgd Use a dark background color on the RO
LargeFont Use a large font – doesn’t affect 640x480 resolution
LabelColor Windows color for the labels
DataColor Windows color for the data
339
Integrating With GoldMine
Name Description
WarnAboutDeleteMultiLinkActiv Show alert when deleting an activity with others
associated
340
Integrating With GoldMine
341
Integrating With GoldMine
Name Description
AlarmsLead Time before an event that an alarm fires
AlarmFreq Scan for alarm every xx seconds
TaskBarReminder Reminder shown for x minutes
IgnoreSnooze Amount of to snooze an ignored alarm
PageAlarm Page user with alarm when not acknowleged within xx
minutes.
GMAlarmSound Path to the alarm sound
342
Integrating With GoldMine
343
Integrating With GoldMine
344
Integrating With GoldMine
345
Integrating With GoldMine
346
Integrating With GoldMine
Value Description
1 Table is MSSQL
2 Table is Firebird
3 or higher Unknown DB type
347
Integrating With GoldMine
Value Description
-3 Not a master user
-4 Could not lock record
1 Success
348
Integrating With GoldMine
349
Integrating With GoldMine
Name Description
CloseBy The date to close by
ForProb The probability of the item success
ForAmt The projected value of the item
CloseAmt The actual value of the item
Notes Item notes
350
Integrating With GoldMine
351
Integrating With GoldMine
This function will tell you when the user has given your control’s container focus in
GoldMine.
public void GMLostFocus()
Called whenever the user gives focus to another object when your control had focus.
public void GMOnDestruct()
Called when the window is just about to close. This allows you the opportunity to
clean up.
public void GMHandleFile(BSTR sPath)
Used to open associated files with your plug-in. the passed Path is the path to the file
itself that your plug-in described it could handle.
352
Integrating With GoldMine
</Language>
<Language Locale="4000">
<Name>eegay ale-may</Name>
<Publisher>oogle-Gay</Publisher>
<Description>aunches-Lay oogle-Gay’s eegay
ale-may Urvice-Say</Description>
<Menu>aunch-Lay eegay ale-may</Menu>
<MenuPath>eb-Way ased-Bay ools-Tay\\oogle-
Gay</MenuPath >
</Language>
</Description>
<OnDemand>1</OnDemand>
<Startup>1</Startup>
<MultipleInstance>0</MultipleInstance>
<Modal>0</Modal>
<DefaultPos>
<top>50</top>
<left>50</left>
</DefaultPos>
<DefaultSize>
<width>800</width>
<height>600</height>
</DefaultSize>
<Visible>1</Visible>
<IconFile>google.ico</IconFile>
<InternalName>GOOGLE_MAIL</InternalName>
</PlugInDef>
</PlugInDefs>
The root node must be PlugInDefs, and as the name implies, multiple plug-ins can
be installed under one definition file. For each plug-in, there is one PlugInDef. The
child nodes for PlugInDef are:
Node Description
<URL> The URI for the html or site – must be http://, https:// or
file://
<QueryString> The querystring to be tacked on to the end of the URL.
Can contain GoldMine field macros that will be
evaluated on launch of the plug-in. The macro wrapping
structure is <<field>>, like <<&Contact>> or
<<Contact1->AccountNo>>. Please note that you must
XMLEncode the macros like above.
<Description> These values describe the item to the user.
<Language> Uses the locale code associated with the target
language. One Langauge structure must be marked as
IsDefault, and this one is used in case the target
language is not supported by the plug-in. Always use
XML entities in place of extended characters. ( Ñ would
be Ñ )
353
Integrating With GoldMine
“ABCDEFGHIJKLMNOPQRSTUVWXYZ_1234567890
”
354
Integrating With GoldMine
<PlugInDef>
<ProgID>myApp.ClassInstance</ProgID>
<Installer>myAppInstaller.exe</Installer>
<Description>
<Language Locale="1033" IsDefault="1">
<Name>My Fantastical App</Name>
<Publisher>JCS</Publisher>
<Description>This app does it
all!!!</Description>
<Menu>The most amazing app EVER</Menu>
<MenuPath>You\\Can\\Expect\\To
Be\\AMAZED</MenuPath >
</Language>
<Language Locale="4000">
<Name>eegay ale-may</Name>
<Publisher>oogle-Gay</Publisher>
<Description>aunches-Lay oogle-Gay’s eegay
ale-may Urvice-Say</Description>
<Menu>aunch-Lay eegay ale-may</Menu>
<MenuPath> ou-Yay\\an-Kay\\Expect-ay\\o-tay ebay\\AMAZED-
AY</MenuPath >
</Language>
</Description>
<OnDemand>1</OnDemand>
<Startup>1</Startup>
<MultipleInstance>0</MultipleInstance>
<Modal>0</Modal>
<DefaultPos>
<top>50</top>
<left>50</left>
</DefaultPos>
<DefaultSize>
<width>800</width>
<height>600</height>
</DefaultSize>
<Visible>1</Visible>
<IconFile>MYAPP.ico</IconFile>
<InternalName>BEST_APP_EVER</InternalName>
<HandledFileExtensions>doc;xls;pdf;txt;ini</HandledFileExtension
s>
<Methods>
<Method>
<Language Locale="1033" IsDefault="1">
355
Integrating With GoldMine
356
Integrating With GoldMine
Security
For security, GM.INI has precedence over the user INI file. There are two methods –
Optimistic and Pessimistic. You can have different methods for GM.INI and the user
INI, but Pessimistic will win out.
The Optimistic method is as follows:
[PlugIns]
allow_by_default=1
The Pessimistic method is as follows:
[PlugIns]
deny_by_default=1
If you had allow_by_default=0, then this would be the same as deny_by_default=1 –
and vice versa. If the keys are missing, then the method is assumed to be Optimistic.
If you are using the Optimistic method, then you do not have to add anything
besides blocked plug-ins to the INI files. If you are using the Pessimistic method,
then you must give a plug-in permission to run.
For example, if you have a plug-in with a Name node of “Evil Plugin …”
The INI name for this would be EVILPLUGIN unless you added the InternalName
element to your plug-in description.
To block the plug-in with Optimistic mode:
[PlugIns]
allow_by_default=1 or deny_by_default=0
EVILPLUGIN=0
To allow a plug-in with Pessimistic mode:
[PlugIns]
deny_by_default=1 or allow_by_default=0
GOODPLUGIN=1
Sample Plug-ins
The following are examples of the GoldMine plug-in capabilities
357
Integrating With GoldMine
gmail.gme
This plug-in opens a browser window to the Google mail address. It demonstrates
the basic capability of opening a browser window from GoldMine.
<?xml version="1.0" encoding="UTF-8"?>
<PlugInDefs>
<PlugInDef>
<URL>http://gmail.google.com/gmail</URL>
<Description>
<Language Locale="1033" IsDefault="1">
<Name>G-Mail</Name>
<Publisher>Google</Publisher>
<Description>Launches Google's Gmail
Service</Description>
<Menu>Launch GMAIL</Menu>
</Language>
</Description>
<OnDemand>1</OnDemand>
<Startup>1</Startup>
<MultipleInstance>0</MultipleInstance>
<Modal>0</Modal>
<DefaultPos>
<top>50</top>
<left>50</left>
</DefaultPos>
<DefaultSize>
<width>800</width>
<height>600</height>
</DefaultSize>
<Visible>1</Visible>
</PlugInDef>
</PlugInDefs>
External.gme
This plug-in allows a user to store more than the 254 custom fields for a contact
record externally. Users can select any contact record, then select the plug in, to
either add new information or update existing information depending on what is
found in the database.
<?xml version="1.0" encoding="UTF-8"?>
<PlugInDefs>
<PlugInDef>
<URL>http://localhost/gmplus.asp</URL>
<QueryString>accountno=<<&Accountno>></QueryStr
ing>
358
Integrating With GoldMine
<Description>
<Language Locale="1033" IsDefault="1">
<Name>Extra Fields</Name>
<Publisher>Robie</Publisher>
<Description>Access External
Tables</Description>
<Menu>Access External Tables</Menu>
</Language>
</Description>
<OnDemand>1</OnDemand>
<MultipleInstance>1</MultipleInstance>
<Modal>0</Modal>
<DefaultPos>
<top>50</top>
<left>50</left>
</DefaultPos>
<DefaultSize>
<width>600</width>
<height>590</height>
</DefaultSize>
<Visible>1</Visible>
</PlugInDef>
</PlugInDefs>
gmplus.asp
Following is the source listing for gmplus.asp, which is the corresponding ASP page
for the External.gme plug-in.
Note: The following code sample uses text wrapping in order to fit the
sample on these pages. Make sure that the lines in your actual code do not
wrap.
<html>
<body>
<h3>External Location Information</h3>
<%
Dim action
Dim DSNConnection
Dim SQLTable
'Update the DSN information here to access the SQL database HERE.
DSNConnection = "Driver=SQL
Server;Server=CompanyServerName;Database=GMplus;Uid=sa;Pwd=sa;"
'Update to table in database
SQLTable = "GoldPlus"
359
Integrating With GoldMine
set conn=Server.CreateObject("ADODB.Connection")
conn.Open (DSNConnection)
'This is the SQL statement that updates information, so you will need
to add/edit fields here too.
set rs = Server.CreateObject("ADODB.recordset")
strSQL = "UPDATE "+ SQLTable +" SET document = '" + strdocument +"',
location = '" + strlocation + "', extrastuff1 = '" + strextrastuff1 +
"' WHERE accountno = '" + straccountno + "'"
Conn.Execute (strSQL)
conn.close
set conn = nothing
set strSQL = nothing
'This does a redirect to the update page once the data is entered
into the SQL database
Response.write("<meta http-equiv=refresh
content=0;url=gmplus.asp?accountno=" + straccountno + ">")
'********************************************************************
*********************************************
'This section does the addition of the fields if they are not found
in the database
else if Request("action")="add" then
set conn=Server.CreateObject("ADODB.Connection")
conn.Open (DSNConnection)
conn.close
set conn = nothing
360
Integrating With GoldMine
set conn=Server.CreateObject("ADODB.Connection")
conn.Open (DSNConnection)
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT accountno, document, location, extrastuff1 from "+
SQLTable +" where accountno ='"+ straccountno +"'" , conn
'********************************************************************
********************
'if the AccountNo is NOT found, display the ADD form
if rs.eof AND rs.bof then
%>
<form action="gmplus.asp" method="get">
<input type="hidden" name="action" value="add">
<% Response.Write("<input type=hidden name=accountno value="+
straccountno +">")%>
<table border="1">
<tr>
<td>Document</td><td><input type="text" name="document"
size="30"></td>
<tr>
</tr>
<td>Location</td><td><input type="text" name="location"
size="30"></td>
<tr>
</tr>
<td>Extra Stuff 1</td><td><input type="text"
name="extrastuff1" size="30"></td>
</tr>
</table>
<input type="Submit" value="add">
</form>
<%'******************************************************************
***********************
else
'if the AccountNo IS found, display the UPDATE form
%>
<form action="gmplus.asp" method="get">
<input type="hidden" name="action" value="update">
361
Integrating With GoldMine
<%'******************************************************************
**********************
end if
end if
%>
</body>
</html>
362
Integrating With GoldMine
Improper use of these functions may result in data that is not recoverable. Be sure to
back up your data frequently.
363
Integrating With GoldMine
Filter expressions work equally well on Xbase or SQL tables. With SQL, the Xbase
filter is evaluated on the client side, not the server side.
The following pages list Xbase functions in three sections:
• Function/Parameter Types
• Conditionals, Operators, and Logical Evaluators
• Xbase Functions
Function/Parameter Types
Xbase functions recognize and return several types of data. These data types
represent the format of the data, such as a number. To properly evaluate and return
a value, a function must include the correct parameter types. For example, a function
may require that a date be passed as a parameter. Trying to pass a name to the
function would not be accepted. In many cases, you can use a special function to
convert one data type to another.
Data types may be referenced literally, either as a field name of a specific type, or as
the result of an Xbase function.
The following list describes valid data types for Xbase functions and shows
examples of use when referenced as a literal, field value, or function result.
Boolean Value that results whenever a comparison is made. Boolean values are either
TRUE or FALSE.
For an expanded description of Boolean expressions, see “Using Boolean Expressions” in the online
Help.
364
Integrating With GoldMine
Conditionals
Conditional: >
Conditional: <
365
Integrating With GoldMine
Conditional: <>
Conditional: >=
Conditional: <=
Operators
Operator: +
366
Integrating With GoldMine
Operator: -
Operator: /
Operator: *
Operator: %
Description: Modulus
Logical Evaluators
Logical: .OR.
Logical: .AND.
367
Integrating With GoldMine
Logical: .NOT.
Xbase Functions
GoldMine recognizes four types of Xbase functions as valid
• String: Use primarily for manipulating string data types. A string
function can return other data types.
• Date: Use for any date-related operations. A date function can return
other data types.
• Numeric: Use for numeric operations. A numeric function can return
other data types.
• Miscellaneous: Additional functions that fall outside of the previous
three categories of data types. These may return any type of data.
For convenience, functions are listed under these four categories, according to how
they are most typically used. For example, under “Date Functions,” you will find
those functions that return numeric or string types from dates.
String Functions
ALLTRIM(<string>) Returns a string value with both leading and trailing spaces
from <string>.
Return type: String
Example
“[“+ALLTRIM(“ This is a test “)+”]”
returns [This is a test].
368
Integrating With GoldMine
369
Integrating With GoldMine
MID(<string>, <start>, Returns the string of <length> characters starting at position <start>
<length>) within <string>.
Return type: String
Example
MID("Four score and seven",6,5)
returns score.
PAD(<string>, <length>, Returns <string> padded to <length> with the <fill> character.
<fill>, <mode>) <fill>
This optional parameter defaults to a space.
<mode>
can be 0 for right pad (default), 1 for centered, and 2 for left pad.
Return type: String
Example
PAD(“TEST”, 8, “x”, 1)
returns xxTESTxx.
PADL(<string>, <length>, Returns <string> padded to <length> with the <fill> character.
<fill>) <fill>
This optional parameter defaults to a space. PADL pads from the left.
Return type: String
Example
PADL("TEST", 8, "x")
returns xxxxTEST.
PADR(<string>, <length>, Same as PADL, except that PADR pads the string to the right.
<fill>) Return type: String
Example
PADR("TEST", 8, "x")
returns TESTxxxx.
PROPER(<string>) Returns a string in which the first letter of each word in <string> is
capitalized, and the all following letters are lower-case.
Return type: String
Example
PROPER("fighting IRISH")
returns Fighting Irish.
370
Integrating With GoldMine
371
Integrating With GoldMine
Date Functions
ACCDATE(<string>) Returns a date value for <string>, where <string> is a valid GoldMine
AccountNo.
Return type: Date
Example
ACCDATE(Contact1->ACCOUNTNO)
returns 4/20/99.
CTOD(<string>) Returns a date value based on <string>. The <string> parameter should be
in the format: mm/dd/yy.
Return type: Date
Example
CTOD("4/20/99")+5
returns 4/25/99.
DATE() Returns today’s date in date format. To add/subtract from this value, simply
use the number of days in your expression. For example: DATE()+7 will
add seven days to today's date.
Return type: Date
Example
Assuming today’s date is 4/20/99, DATE()+7
returns 4/27/99.
DAY(<date>) Returns that day of the month for the specified <date>.
Return type: Numeric
Example
DAY(DATE())
returns 18.
DOW(<date>) Returns the day of the week in numeric format; for example, Sunday = 0,
Monday = 1, and so on
Return type: Numeric
Example
DOW(STOD("19990909"))
returns 4.
372
Integrating With GoldMine
DOY(<date>) Returns the number of days elapsed from the beginning of the year in
<date> to the month/day in <date>.
Return type: Numeric
Example
DOY(Contact2->UDATE)
returns 220.
STOD(<string>) Converts a <string> value into a date value. <string> should be in the
format YYYYMMDD.
Return type: Date
Example
STOD("20000121")
returns 1/21/2000.
WDATE(<date>, Returns the <date> formatted in variety of ways, based on the optional
<format>) parameter <format>.
<format>
2 mmm dd Jan 21
The Long date style format 3 is taken from the Windows Regional Settings.
Return type: String
Example
WDATE(Contact2->UDATE, 1)
returns Thu, Jan 21, 00.
373
Integrating With GoldMine
Numeric Functions
CEILING(<number>) Returns the nearest integer that is greater than or equal to the numeric
expression.
Return type: Numeric
Example
CEILING(3.1)
returns 4.
FLOOR(<number>) Returns the nearest integer that is less than or equal to the numeric
expression
Return type: Numeric
Example
FLOOR(2.8)
returns 2.
374
Integrating With GoldMine
375
Integrating With GoldMine
Miscellaneous Functions
RECCOUNT() Returns the number of records in Contact1. (May be time-consuming on
large SQL tables.)
Return type: Numeric
Example
RECCOUNT()
returns 35671
RECNO() Returns the current record number (Xbase) or RecID (SQL) for the active
Contact1 record.
Return type: Numeric
Example
RECNO()
returns 351.
RECNOCOUNT() Returns the current record number and total records. This function is not
available for SQL tables.
Return type: String
Example
RECNOCOUNT()
returns 236 of 2204.
376
Xbase Database Structures
This chapter is provided for programmers who want to integrate their programs
with GoldMine Xbase format database structures.
Third-party developers are encouraged to integrate their products with GoldMine,
thereby enhancing both products. If you design a commercial program that works
with GoldMine, please contact FrontRange Solutions so we can include your
program in our Enhancement Guide.
This chapter describes the file organization and structures of GoldMine databases in
an Xbase format. Each database file is listed separately and includes its associated
index files, database structure, and special notes. For information about working
with GoldMine databases in an SQL format, see Chapter 7 on page 393. The
following pages describe the database structures of most GoldMine .DBF files. This
chapter does not include a discussion of every database. Security and system
database files are not included in this section. You should not interface with these
files. For an in-depth discussion on interfacing with GoldMine, visit the
Public.GoldMine.Programming newsgroup, which you can access directly from the
FrontRange Solutions Web site at http://www.frontrange.com.
Most GoldMine files are stored in the GOLDMINE\GMBASE directory. These files
include most database and index files. The contact sets (CONT*.*) are stored in a
separate directory to allow GoldMine to handle multiple contact sets.
If you will be developing an application to read and write to the GoldMine databases,
we recommend that you use Dynamic Data Exchange (DDE) as described in “Dynamic
Data Exchange (DDE) on page 27 or the functions contained within GMXS32.DLL, as
377
Integrating With GoldMine
described in “Using GMXS32.DLL for Database Access and Sync Log Updates” on page
89. If you choose to write directly to our files without using DDE, you must be aware of
the field/index structure and synchronization methodology used by GoldMine to
ensure full compatibility.
To view how GoldMine uses RECTYPEs for various purposes, create a contact set,
create sample contacts, and then create sample activities, and so on. Place obvious
values in each of the fields. Use a database viewing utility, such as BR4, MS-Access,
or Excel to view the sample records.
Do not view your live contact database with an external application. Do not edit
GoldMine fields with an external application.
CAL.DBF
Directory: GMBASE
Description: Calendar file—contains a record for each scheduled activity. The different record
types are distinguished by the contents of the RECTYPE field. Different RECTYPEs
may use each field for a different purpose.
CAL Indexes
Name Key
Cal Rectype+userID+DTOS(onDate)+onTime
Calcont AccountNo+rectype+DTOS(onDate)+onTime
Caldate UserID+DTOS(onDate)+onTime
Calprob Rectype+userID+Str(999-duration,3)
Calalarm AlarmFlag+userID+DTOS(ALARMDATE)+alarmTime
Calrlink lopRecID+RECTYPE+DTOS(ONDATE)+ONTIME
Calrecid recId
CAL Structure
Field Name Type Len Description
USERID String 8 User Name
ACCOUNTNO String 20 Account Number of linked contact
ONDATE Date 8 Activity date
ONTIME String 5 Activity Time
ENDDATE Date 8 Ending Date of Scheduled Activity
ALARMFLAG String 1 Alarm Flag
ALARMTIME String 5 Alarm Time
ALARMDATE Date 8 Alarm Date
ACTVCODE String 3 Activity Code
378
Integrating With GoldMine
CONTACT1.DBF
Directory: COMMON
CONTACT1 Indexes
Name Key
Contacc AccountNo
* The RECTYPE field contains the Calendar’s activity type. The following values are possible contents of RECTYPE:
A Appointment F Literature fulfillment S Sales potential
C Call Back M Message T Next action
D To-do O Other
E Event Q Queued e-mail
379
Integrating With GoldMine
Name Key
Contcomp Upper(company)+Substr(accountNo,10,4)
Contname Upper(contact)+Substr(accountNo,10,4)
Contzip zip+Substr(accountNo,10,4)
Contcity Upper(city)+Substr(accountNo,10,4)
Contkey1 Upper(key1)+Substr(accountNo,10,4)
Contkey2 Upper(key2)+Substr(accountNo,10,4)
Contkey3 Upper(key3)+Substr(accountNo,10,4)
Contkey4 Upper(key4)+Substr(accountNo,10,4)
Contkey5 Upper(key5)+Substr(accountNo,10,4)
Contlast Upper(lastName)+Substr(accountNo,10,4)
CONTSTAT Upper(STATE+CITY)+SUBSTR(ACCOUNTNO,10,4)
CONTCNTY UPPER(COUNTRY+STATE)+SUBTR(ACCOUNTNO,10,4)
Contphon phone1+Substr(accountNo,10,4)
Cn1Recid recid
CONTACT1 Relations
Related File->Field Contact1 Field
Contact2->AccountNo Contact1->AccountNo
ContHist->AccountNo Contact1->AccountNo
ContSupp->AccountNo Contact1->AccountNo
Cal->AccountNo Contact1->AccountNo
CONTACT1 Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account Number*
COMPANY String 40 Company Name
CONTACT String 40 Contact Name
LASTNAME String 15 Contact’s Last Name
DEPARTMENT String 35 Department
TITLE String 35 Contact Title
SECR String 20 Secretary
PHONE1 String 25 Phone 1
PHONE2 String 25 Phone 2
380
Integrating With GoldMine
** Position 1 of the Internal Status field keeps track of the type of phone number for the contact. If the first character is U, the phone numbers
are formatted for USA-style phone numbers: (999)999-9999.
Position 2 indicates the curtain level (0=none, 1=partial, 2=full)
Position 3 indicates a record alert is present if the value is 1.
381
Integrating With GoldMine
CONTACT2.DBF
Directory: COMMON
Description: Contact file—contains the additional fields of contact records. Each complete
contact record has a record in this file. User-defined field data is stored in this file.
CONTACT2 Index
Name Key
Contact2 accountNo
Cn2Recid recId
CONTACT2 Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account Number
CALLBACKON Date 8 Call Back Date
CALLBACKAT String 8 Call Back Time (unused compatibility field)
CALLBKFREQ Smallint 3 Call Back Frequency
LASTCONTON Date 8 Last Contact Date
LASTCONTAT String 8 Last Contact Time
LASTATMPON Date 8 Last Attempt Date
LASTATMPAT String 8 Last Attempt Time
MEETDATEON Date 8 Meeting Date
MEETTIMEAT String 8 Meeting Time
COMMENTS Date 65 Comments
PREVRESULT String 65 Previous Results
NEXTACTION String 65 Next Action
ACTIONON Date 8 Next Action Date
CLOSEDATE Date 8 Expected Close Date
USERDEF01 String 10 User Defined 1
USERDEF02 String 10 User Defined 2
USERDEF03 String 10 User Defined 3
USERDEF04 String 10 User Defined 4
USERDEF05 String 10 User Defined 5
USERDEF06 String 10 User Defined 6
USERDEF07 String 10 User Defined 7
USERDEF08 String 10 User Defined 8
USERDEF09 String 10 User Defined 9
USERDEF10 String 10 User Defined 10
382
Integrating With GoldMine
CONTGRPS.DBF
Directory: COMMON
Description: Groups file—the CONTGRPS file is used for both the group header, which defines
each group, and members for each group.
CONTGRPS Indexes
Name Key
GroupNo UPPER(userID+code)
GroupAcc accountno+userID
GrpRecID recId
CONTHIST.DBF
Directory: COMMON
* The ACCOUNTNO field contains the following information when the CONTGRPS record is a group header record:
Positions Value
1–8 “*M”
15–20 Total members in group
The next available group number is stored in the CODE field in the first physical record in CONTGRPS.DBF.
383
Integrating With GoldMine
CONTHIST Indexes
Name Key
ContHist accountNo+DTOS(onDate)+RECID
ContHusr USERID+SRECTYPE+DTOS(ONDATE)+RECID
CNHRLink lopRecId+DTOS(ONDATE)
CnHRecid recId
CONTHIST Structure
Field Name Type Len Description
USERID String 8 User
ACCOUNTNO String 20 Account No.
SRECTYPE String 1 First character of RecType
RECTYPE String 10 Record Type*
ONDATE Date 8 Action Date
ONTIME String 5 Action Time
ACTVCODE String 3 Activity Code
RESULTCODE String 3 Result Code
STATUS String 2 First character is flag, second character =1 if notes exist
DURATION String 8 Duration
UNITS String 8 Units of a Forecasted Sale
REF String 80 Reference
NOTES Memo 1 Notes
LINKRECID String 15 Linked Record ID
LOPRECID String 15 Linked Opp. Mgr. Record
CREATEBY String 8 Creation User
CREATEON Date 8 Creation Date
CREATEAT String 6 Creation Time
LASTUSER String 8 Last Modified By
LASTDATE Date 8 Last Modified Date
LASTTIME String 6 Last Modified Time
* The RECTYPE field contains the completed activity’s type. The following values are possible contents of RECTYPE:
A Appointment M Sent message CI Incoming call
C Phone call O Other CM Returned message
D To-do S Sale CO Outgoing call
E Event T Next action MG E-mail message
F Literature fulfillment U Unknown MI Received e-mail
L Form CC Call back MO Sent e-mail
384
Integrating With GoldMine
CONTSUPP.DBF
Directory: COMMON
CONTSUPP Indexes
Name Key
ContSupp accountNo+recType+UPPER(contact)
Contspfd UPPER(RECTYPE+CONTACT+CONTSUPREF)
Cnsrecid recId
CONTSUP Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account No.
RECTYPE String 1 Record Type*
CONTACT String 30 Contact Name/Profile
TITLE String 35 Contact Title/Referral’s Account Number
CONTSUPREF String 35 Reference
DEAR String 20 Dear (Salutation)
PHONE String 20 Phone
EXT String 6 Phone Extension
FAX String 20 FAX number
LINKACCT String 20 Linked Account
NOTES Memo 1 Notes
ADDRESS1 String 40 Additional Contact Address 1
ADDRESS2 String 40 Additional Contact Address 2
ADDRESS3 String 40 Additional Contact Address 3
* The RECTYPE field contains the record type. The following values are possible contents of RECTYPE:
C Additional contact record O Organizational chart
E Automated Process attached event P Profile record/extended profile record
H Extended profile header R Referral record
L Linked document
The RECTYPE value H can be linked to records with the RECTYPE value P. Assigning extended information settings to a profile (assigned to
a tab, or extended fields used) creates an H record type to store the settings. The profile record stores a character string in the Phone field that matches
the H record’s ACCOUNTNO field.
385
Integrating With GoldMine
INFOMINE.DBF
Directory: GMBASE
INFOMINE Indexes
Name Key
infomine UPPER(rectype+LEFT(TSECTION,80)+LEFT(TOPIC,10)
infosort sortKey
infotran recType+recID
infrecid recId
INFOMINE Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account No.
CREATEBY String 8 Creation User
RECTYPE String 10 Record Type
SORTKEY String 20 Sort Key
TSECTION String 100 Section
TOPIC String 80 Topic
KEYWORDS String 80 Keywords
OPTIONS String 10 Options
OPTIONS1 String 20 Options1
OPTIONS2 String 20 Options2
386
Integrating With GoldMine
LOOKUP.DBF
Directory: GMBASE
LOOKUP Indexes
Name Key
Lookup UPPER(FIELDName+entry)
lkurecid recId
LOOKUP Structure
Field Name Type Len Description
FIELDNAME String 11 Field Name
LOOKUPSUPP String 10 Lookup Options
ENTRY String 40 Description
RECID String 15 Record ID
387
Integrating With GoldMine
MAILBOX.DBF
Directory: GMBASE
MAILBOX Indexes
Name Key
mboxlink LinkRecId
mboxuser userId+folder+FOLDER2+DTOS(MAILDATE)
mbxrecid recId
MAILBOX Structure
Field Name Type Len Description
LINKRECID String 15 Linked Record ID
FLAGS String 8 Flags*
USERID String 8 User Name
FOLDER String 20 Folder**
FOLDER2 String 20 Subfolder
ACCOUNTNO String 20 Account No.
CREATEON Date 8 Creation Date
MAILSIZE String 8 Mail Size
MAILDATE Date Mail Date
MAILTIME String 8 Mail Time
MAILREF String 100 Reference
RFC822 Memo 1 Entire Mail Message
RECID String 15 Record ID
* The FLAGS field is a String type, but actually stores a number. When the number is converted to binary, the following rules apply:
Bit On Off
1 Read Not Read
2 In History Not in History
3 Outbound Inbound
4 Attachments No Attachments
** The FOLDER field contains the name of the folder in which mail is stored. GoldMine uses the following predefined folders:
X-GM-INBOX -Inbox
X-GM-OUTBOX -Outbox
X-GM-TEMPLATES -Templates
388
Integrating With GoldMine
OPMGR.DBF
Directory: GMBASE
Description: Opportunity Manager file—stores all data maintained in the Opportunity Manager
OPMGR Indexes
Name Key
OpMgr UPPER(recType+userID+stage)
OpId opId+recType
OPACCNO ACCOUNTNO+RECTYPE+OPID
OpRecID recID
OPMGR Structure
Field Name Type Len Description
OPID String 15 Opportunity ID
RECTYPE String 3 Record Type*
ACCOUNTNO String 20 Account No.
USERID String 8 User Name
FLAGS String 10 Flags
COMPANY String 40 Company
CONTACT String 40 Contact
NAME String 50 Name
STATUS String 50 Status
CYCLE String 50 Cycle
STAGE String 30 Stage
SOURCE String 30 Source
F1 String 20
F2 String 20
F3 String 10
STARTDATE Date 8 Start Date
CLOSEDDATE Date 8 Close Date
CLOSEBY Date 8 Close by
FORAMT Float 10 For Amount
* The following OpMgr rectypes are valid, where x represents O for opportunity records, or P for project records:
389
Integrating With GoldMine
PERPHONE.DBF
Directory: GMBASE
Description: Personal Rolodex file—contains a record of each entry in the user’s Rolodex
PERPHONE Indexes
Name Key
Perphone UPPER(recType+userID+contact)
pphrecid recId
PERPHONE Structure
Field Name Type Len Description
RECTYPE String 1 Record Type
USERID String 8 User Name
STATUS String 2 Status
CONTACT String 30 Contact Name
PHONE1 String 16 Phone Number
RECID String 15 Record ID
RESITEMS.DBF
Directory: GMBASE
Description: Resources file—stores data regarding equipment, facilities, and other resources
that you can schedule from the Resources’ Master File.
RESITEMS Indexes
Name Key
resource name
rscrecid recid
390
Integrating With GoldMine
RESITEMS Structure
Field Name Type Len Description
NAME String 8 Name
CODE String 10 Code
RESDESC String 40 Description
CUSTODIAN String 8 Custodian
NOTES Memo 1 Notes
RECID String 15 Record ID
SPFILES.DBF
Directory: GMBASE
SPFILES Index
Name Key
Spfiles UPPER(dirPath)
Sflcode dirCode
sflrecid recId
SPFILES Structure
Field Name Type Len Description
DIRNAME String 35 Contact file description
DIRPATH String 100 Contact file path
391
SQL Database Structures
Third-party developers are encouraged to integrate their products with GoldMine,
thereby enhancing both products. If you design a commercial program that works
with GoldMine, please contact FrontRange Solutions so we can include your
program in our Enhancement Guide.
This chapter describes the file organization and structures of Goldmine SQL format
databases in an SQL format. Each database file is listed separately and includes its
associated index files, database structure, and special notes. For information about
working with the GoldMine Xbase format database, see Chapter 6 on page 377. The
following pages describe the database structures of most GoldMine .DBF files. This
chapter does not include a discussion of every database. Security and system
database files are not included in this section. You should not interface with these
files. For an in-depth discussion on interfacing with GoldMine, visit the
Public.GoldMine.Programming newsgroup, which you can access directly from the
FrontRange Solutions Web site at www.frontrange.com.
If you will be developing an application to read and write to the GoldMine databases,
we recommend that you use Dynamic Data Exchange (DDE) as described in “Dynamic
Data Exchange (DDE) on page 27 or the functions contained within GMXS32.DLL, as
described in “Using GMXS32.DLL for Database Access and Sync Log Updates” on page
89. If you choose to write directly to our files without using DDE, you must be aware of
the field/index structure and synchronization methodology used by GoldMine to
ensure full compatibility.
393
Integrating With GoldMine
To view how GoldMine uses RECTYPEs for various purposes, create a contact set,
create sample contacts, and then create sample activities, and so on. Place obvious
values in each of the fields. Use a database viewing utility, such as MS-Access,
MSSQL Enterprise Manager, or isql to view the sample records.
Do not view your live contact database with an external application. Do not edit
GoldMine fields with an external application.
CAL Table
Description: Calendar file—contains a record for each scheduled activity. The different record
types are distinguished by the contents of the RECTYPE field. Different
RECTYPEs may use each field for a different purpose.
CAL Indexes
Name Index Tags Unique?
CALCONT ACCOUNTNO+RECTYPE+ONDATE+ONTIME+RECID No
CAL RECTYPE+USERID+ONDATE+ONTIME+RECID No
CALDATE USERID+ONDATE+ONTIME+RECID No
CALPROB RECTYPE+USERID No
CALALARM ALARMFLAG+USERID+ALARMDATE+ALARMTIME No
CALRLINK LOPRECID+RECTYPE+ONDATE+ONTIME No
CALRECID RECID Yes
CAL Structure
Field Name Type Len Description
USERID String 8 User Name
ACCOUNTNO String 20 Account Number of linked contact
ONDATE Date 8 Activity date
ONTIME String 5 Activity Time
ENDDATE Date 8 Ending Date of Scheduled Activity
ALARMFLAG String 1 Alarm Flag
ALARMTIME String 5 Alarm Time
ALARMDATE Date 8 Alarm Date
ACTVCODE String 3 Activity Code
RSVP String 1 RSVP Notification
394
Integrating With GoldMine
CONTACT1 Table
Description: Contact file—contains the main fields of contact records
CONTACT1 Indexes
Name Index Tags Unique?
CONTACC ACCOUNTNO No
CONTCNTY U_COUNTRY+U_STATE+ACCOUNTNO No
CONTCOMP U_COMPANY+ACCOUNTNO No
* The RECTYPE field contains the calendar’s activity type. The following values are possible
contents of RECTYPE:
A Appointment F Literature fulfillment S Sales potential
C Call Back M Message T Next action
D To-do O Other
E Event Q Queued e-mail
395
Integrating With GoldMine
CONTACT1 Relations
Related File->Field Contact1 Field
Contact2->AccountNo Contact1->AccountNo
ContHist->AccountNo Contact1->AccountNo
ContSupp->AccountNo Contact1->AccountNo
Cal->AccountNo Contact1->AccountNo
CONTACT1 Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account Number*
COMPANY String 40 Company Name
CONTACT String 40 Contact Name
LASTNAME String 15 Contact’s Last Name
DEPARTMENT String 35 Department
TITLE String 35 Contact Title
SECR String 20 Secretary
PHONE1 String 25 Phone 1
PHONE2 String 25 Phone 2
PHONE3 String 25 Phone 3
FAX String 25 Fax
396
Integrating With GoldMine
** Position 1 of the Internal Status field keeps track of the type of phone number for the contact. If the first character is U, the phone numbers
are formatted for USA-style phone numbers: (999)999-9999.
Position 2 indicates the curtain level (0=none, 1=partial, 2=full).
Position 3 indicates a record alert is present if the value is 1.
397
Integrating With GoldMine
CONTACT2 Table
Description: Contact file—contains the additional fields of contact records. Each complete
contact record has a record in this file. User-defined field data is stored in this file.
CONTACT2 Index
Name Index Tags Unique?
CONTACT2 ACCOUNTNO No
CN2RECID RECID Yes
CONTACT2 Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account Number
CALLBACKON Date 8 Call Back Date
CALLBACKAT String 8 Call Back Time (unused compatibility field)
CALLBKFREQ Smallint 3 Call Back Frequency
LASTCONTON Date 8 Last Contact Date
LASTCONTAT String 8 Last Contact Time
LASTATMPON Date 8 Last Attempt Date
LASTATMPAT String 8 Last Attempt Time
MEETDATEON Date 8 Meeting Date
MEETTIMEAT String 8 Meeting Time
COMMENTS Date 65 Comments
PREVRESULT String 65 Previous Results
NEXTACTION String 65 Next Action
ACTIONON Date 8 Next Action Date
CLOSEDATE Date 8 Expected Close Date
USERDEF01 String 10 User Defined 1
USERDEF02 String 10 User Defined 2
398
Integrating With GoldMine
CONTGRPS Table
Description: Groups file—the CONTGRPS file is used for both the group header, which
defines each group, and members for each group.
CONTGRPS Indexes
Name Index Tags Unique?
GROUPNO USERID+U_CODE+RECID No
GROUPACC ACCOUNTNO+USERID No
GRPRECID RECID Yes
* The ACCOUNTNO field contains the following information when the CONTGRPS record is a group header record:
Positions Value
1–8 “*M”
15–20 Total members in group
The next available group number is stored in the CODE field in the first physical record in CONTGRPS.DBF.
399
Integrating With GoldMine
CONTHIST Table
Description: Contact history file—contains a record for each completed activity
CONTHIST Indexes
Name Index Tags Unique?
CONTHIST ACCOUNTNO+ONDATE+RECID No
CONTHUSR USERID+SRECTYPE+ONDATE+RECID No
CNHRLINK LOPRECID+ONDATE No
CNHRECID RECID Yes
CONTHIST Structure
Field Name Type Len Description
USERID String 8 User
ACCOUNTNO String 20 Account No.
SRECTYPE String 1 First character of RecType
RECTYPE String 10 Record Type*
ONDATE Date 8 Action Date
ONTIME String 5 Action Time
ACTVCODE String 3 Activity Code
RESULTCODE String 3 Result Code
STATUS String 2 First character is flag, second character =1 if notes exist
DURATION String 8 Duration
UNITS String 8 Units of a Forecasted Sale
REF String 80 Reference
Field Name Type Len Description
NOTES Memo 1 Notes
LINKRECID String 15 Linked Record ID
LOPRECID String 15 Linked Opp. Mgr. Record
* The RECTYPE field contains the completed activity’s type. The following values are possible contents of RECTYPE:
A Appointment M Sent message CI Incoming call
C Phone call O Other CM Returned message
D To-do S Sale CO Outgoing call
E Event T Next action MG E-mail message
F Literature fulfillment U Unknown MI Received e-mail
L Form CC Call back MO Sent e-mail
400
Integrating With GoldMine
CONTSUPP Table
Description: Supplementary contact set—contains a record for each additional contact record,
referral and profile record. The different record types are distinguished by the
contents of the RECTYPE field. Different RECTYPEs may use each field for a
different purpose.
CONTSUPP Indexes
Name Index Tags Unique?
CONTSUPP ACCOUNTNO+RECTYPE+U_CONTACT+RECID No
CONTSPFD RECTYPE+U_CONTACT+U_CONTSUPREF No
CNSRECID RECID Yes
CONTSUPP Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account No.
RECTYPE String 1 Record Type*
CONTACT String 30 Contact Name/Profile
TITLE String 35 Contact Title/Referral’s Account Number
CONTSUPREF String 35 Reference
DEAR String 20 Dear (Salutation)
PHONE String 20 Phone
EXT String 6 Phone Extension
FAX String 20 FAX number
LINKACCT String 20 Linked Account
* The RECTYPE field contains the record type. The following values are possible contents of RECTYPE:
C Additional contact record O Organizational chart
E Automated Process attached event P Profile record/extended profile record
H Extended profile header R Referral record
L Linked document
The RECTYPE value H can be linked to records with the RECTYPE value P. Assigning extended information settings to a profile (assigned to
a tab or extended fields used) creates an H record type to store the settings. The profile record stores a character string in the Phone field that matches
the H record’s ACCOUNTNO field.
401
Integrating With GoldMine
INFOMINE Table
Description: InfoCenter file—stores all data for the InfoCenter
INFOMINE Indexes
Name Index Tags Unique?
INFOMINE RECTYPE+U_TSECTION+U_TOPIC No
INFOSORT SORTKEY No
INFOTRAN RECTYPE+RECID No
INFRECID RECID Yes
INFOMINE Structure
Field Name Type Len Description
ACCOUNTNO String 20 Account No.
CREATEBY String 8 Creation User
RECTYPE String 10 Record Type
SORTKEY String 20 Sort Key
TSECTION String 100 Section
TOPIC String 80 Topic
KEYWORDS String 80 Keywords
402
Integrating With GoldMine
LOOKUP Table
Description: Lookup file—contains a record of each defined look-up entry
LOOKUP Indexes
Name Index Tags Unique?
LOOKUP FIELDNAME+U_ENTRY No
LKURECID RECID Yes
LOOKUP Structure
Field Name Type Len Description
FIELDNAME String 11 Field Name
LOOKUPSUPP String 10 Lookup Options
ENTRY String 40 Description
U_ENTRY String 40 Upper-case shadow of Description field
RECID String 15 Record ID
MAILBOX Table
Description: E-mail Center mailbox file—stores all GoldMine e-mail
MAILBOX Indexes
Name Index Tags Unique?
MBOXLINK LINKRECID No
MBOXUSER USERID+FOLDER+FOLDER2+MAILDATE No
403
Integrating With GoldMine
MAILBOX Structure
Field Name Type Len Description
LINKRECID String 15 Linked Record ID
FLAGS String 8 Flags*
USERID String 8 User Name
FOLDER String 20 Folder**
FOLDER2 String 20 Subfolder
ACCOUNTNO String 20 Account No.
CREATEON Date 8 Creation Date
MAILSIZE String 8 Mail Size
MAILDATE Date Mail Date
MAILTIME String 8 Mail Time
MAILREF String 100 Reference
RFC822 Memo 1 Entire Mail Message
RECID String 15 Record ID
OPMGR Table
Description: Opportunity Manager file—stores all data maintained in the Opportunity Manager
OPMGR Indexes
Name Index Tags Unique?
OPMGR RECTYPE+USERID+U_STAGE No
OPID OPID+RECTYPE No
OPACCNO ACCOUNTNO+RECTYPE+OPID No
OPRECID RECID Yes
OPMGR Structure
Field Name Type Len Description
OPID String 15 Opportunity ID
RECTYPE String 3 Record Type*
* The FLAGS field is a String type, but actually stores a number. When the number is converted to binary, the following rules apply:
Bit On Off
1 Read Not Read
2 In History Not in History
3 Outbound Inbound
4 Attachments No Attachments
** The FOLDER field contains the name of the folder in which mail is stored. GoldMine uses the following predefined folders:
X-GM-INBOX -Inbox
X-GM-OUTBOX -Outbox
X-GM-TEMPLATES -Templates
* The following OpMgr rectypes are valid, where x represents O for opportunity records, or P for project records:
404
Integrating With GoldMine
PERPHONE Table
Description: Personal Rolodex file—contains a record of each entry in the user’s Rolodex
PERPHONE Indexes
Name Index Tags Unique?
PERPHONE RECTYPE+USERID+U_CONTACT No
PPHRECID RECID Yes
405
Integrating With GoldMine
PERPHONE Structure
Field Name Type Len Description
RECTYPE String 1 Record Type
USERID String 8 User Name
STATUS String 2 Status
CONTACT String 30 Contact Name
PHONE1 String 16 Phone Number
U_CONTACT String 30 Upper-case shadow of Contact field
RECID String 15 Record ID
RESITEMS Table
Description: Resources file—stores data regarding equipment, facilities, and other resources
that you can schedule from the Resources’ Master File.
RESITEMS Indexes
Name Index Tags Unique?
RESITEMS NAME No
RSRECID RECID Yes
RESITEMS Structure
Field Name Type Len Description
NAME String 8 Name
CODE String 10 Code
RESDESC String 40 Description
CUSTODIAN String 8 Custodian
NOTES Memo 1 Notes
RECID String 15 Record ID
SPFILES Table
Description: Contact files directory—contains a record for each GoldMine contact set
SPFILES Index
Name Index Tags Unique?
SFLCODE DIRCODE No
SFLRECID RECID Yes
SPFILES U_DIRPATH No
406
Integrating With GoldMine
SPFILES Structure
Field Name Type Len Description
DIRNAME String 35 Contact file description
DIRPATH String 100 Contact file path
USERID String 8 Contact file user
DIRCODE String 10 Contact Set Code
DBPASSWORD String 36 Database Password
DRIVER String 25 Database Driver
U_DIRPATH String 100 Upper-case shadow of Contact file path
RECID String 15 Record ID
407
Appendix:
Code Examples
This appendix contains code examples for the GMXS32.DLL and GMXMLAPI.DLL
in the following programming languages:
• C++
• Visual Basic
• Delphi
C++ Examples
The following C++ files have been provided as part of this package:
GM5S32.H: C Header file containing all of the GMXS32.DLL function prototypes.
Function prototypes
//////////////////////////
//
// gm5s32.h
409
Integrating With GoldMine
#ifndef __GM5S32_H
#define __GM5S32_H
#ifdef __cplusplus
extern "C" {
#endif
long iReserved1;
long iReserved2;
long szReserved[100];
} GMW_LicInfo;
// DataStream functions
410
Integrating With GoldMine
// Sync functions
int _stdcall GMW_SyncStamp( char *szStamp, char *szOutBuf );
411
Integrating With GoldMine
// misc functions
long _stdcall GMW_UserAccess( long iOption );
struct GMWnv;
typedef GMWnv *HGMNV;
// remove name(s)
void __stdcall GMW_NV_EraseName(HGMNV hgmnv, const char* name);
#ifdef __cplusplus
/* close extern "C" { */
}
#endif
#endif // __GM5S32_H
412
Integrating With GoldMine
Logging In
The following example uses C++ to access the GM5S32.DLL functions The DLL is
dynamically loaded and its function addresses are retrieved using the
GetProcAddress API.
// prototypes
typedef int (*fnGMW_LoadBDE) ( char *szSysDir, char *szGoldDir, char
*szCommonDir, char *szUser );
typedef int (*fnGMW_UnloadBDE) ();
void GM5S32_DLL_Test()
{
// load the GM5S32.DLL
HMODULE hLib = LoadLibrary("GM5S32.DLL");
if( hLib )
{
413
Integrating With GoldMine
{
// allocate buffer for 200 contacts at 40 chars per/name
long iBufSize = 200*40 +20;
char *szBuf = new char[iBufSize];
// Example 2:
// Get a large number of records in 100-record buffers
//
// return all serial numbers beginning with "123...."
//
char *szSQL2 = "SELECT ContSupRef, Address1, AccountNo FROM ContSupp
"
"WHERE RECTYPE = 'P' AND U_CONTACT = 'SERIAL NUMBER' "
"AND U_ContSupRef Like '123%' "
"ORDER BY U_ContSupRef";
// send DataStream SQL Query
if( (iHandle = GMW_DS_Query( szSQL2 )) > 0 )
{
char *szBuf = NULL;
long iBufSize = -1;
// read while the first character of result is 0
while( (szBuf == NULL || szBuf[0] == '0') && iBufSize )
{
// fetch 100 records and get the buffer size needed
// (set the szBuf and iBufSize parameters to 0 to
// fetch the data and retrieve the buffer size needed)
if( iBufSize = GMW_DS_Fetch( iHandle, 0, 0, 100 ) )
{
// delete old buffer and allocate new buffer
delete [] szBuf; szBuf = NULL;
szBuf = new char[iBufSize];
// read the data (nGetRecs is 0 since data is already read)
iOK = GMW_DS_Fetch( iHandle, szBuf, iBufSize, 0 );
// do whatever with the data
ODS( szBuf );
}
}
// make sure to delete the buffer
delete [] szBuf; szBuf = NULL;
// close the query
iOK = GMW_DS_Close( iHandle ); iHandle = 0;
}
return;
}
414
Integrating With GoldMine
415
Integrating With GoldMine
// char of Zip
if( szBuf2[1] == '1' )
break; // found primary address!
}
}
// close the tables
iOK = GMW_DB_Close( iC1 ); iC1 = 0;
iOK = GMW_DB_Close( iCS ); iCS = 0;
}
return;
}{
Function prototypes
' Structure for License function
Public Type GMLicInfo
Licensee As String * 60
LicNo As String * 20
SiteName As String * 20
LicUsers As Long
SQLUsers As Long
GSSites As Long
IsDemo As Long
IsServerLic As Long
IsRemoteLic As Long
ISUSALic As Long
iReserved1 As Long
iReserved2 As Long
iReserved3 As Long
sReserved As String * 100
End Type
416
Integrating With GoldMine
417
Integrating With GoldMine
418
Integrating With GoldMine
As String) As Long
End Function
419
Integrating With GoldMine
Logging In
Dim lResult As Long
Creating a Contact
The following example assumes that GMXS32.DLL has already been loaded and
functions have been declared.
Dim lGMPtr As Long, _
sGMnvm As String, _
sGMvle As String, _
lResult As Long
Enumerating a Container
The following example assumes that GMXS32.DLL has already been loaded and
functions have been declared.
'//Get count from NV for loop
lCount = GMW_NV_Count(lGMPtr)
For i = 1 To lCount
420
Integrating With GoldMine
List1.AddItem sResult
Next
DataStream
The following example assumes that GM5S32.DLL has already been loaded and
functions have been declared.
sFilter = " '" + UCase$(txtMatchValue.Text) + "' $ UPPER(ContSupRef)"
iHandle = GMW_DS_Range("ContSupp", "ContSPFD", "PE-MAIL ADDRESS",
"PE-MAIL ADDRESS~", "ContSupRef;", sFilter, " ", Chr(13) + Chr(10))
If iHandle > 0 Then
Do
'The initial fetch will tell us how much to allocate the
'buffer for a 50 record packet
sBuf = String$(1, 0)
iBufSize = GMW_DS_Fetch(iHandle, sBuf, 0, 50)
Low-Level WorkArea
The following example assumes that GMXS32.DLL has already been loaded and
functions have been declared. The example opens up the CONTACT1 and
CONTSUPP tables to find a particular contact’s phone number and primary e-mail
address. The Contact name is stored in a VB Text box.
Dim lC1WA As Long
Dim lC2WA As Long
Dim lCSWA As Long
Dim lRes As Long
Dim sAccNo As String
Dim sBuf1 As String
Dim sBuf2 As String
'Initialization
lblEmail.Caption = ""
lblPrevresult.Caption = ""
421
Integrating With GoldMine
lblCompany.Caption = ""
lblPhone.Caption = ""
sAccNo = String$(21, 0)
422
Integrating With GoldMine
Delphi Examples
This section includes function prototypes and examples.
Function prototypes
Type
TGMW_LicInfo = record
Licensee: array [0..59] of char;
LicNo: array [0..19] of char;
SiteName: array [0..19] of char;
LicUsers,
SQLUsers,
GSSites,
IsDemo,
IsServerLic,
IsRemoteLic,
IsUSALic,
DLLVersion,
Reserved1,
Reserved2:longint;
Reserved: array [0..99] of char;
end;
Type
hgmnv = pointer;
423
Integrating With GoldMine
424
Integrating With GoldMine
425
Integrating With GoldMine
// remove name(s)
procedure GMW_NV_EraseName(PGMNV: hgmnv; Name: PChar); stdcall;
external 'GM5S32.DLL';
426
Integrating With GoldMine
// Login to GM5
iRet := GMW_LoadBDE('C:\GM5', 'C:\GM5\GMBASE', 'C:\GM5\DEMO',
'NELSON' , '');
Creating a Contact
The following example assumes that GMXS32.DLL has already been loaded and
function addresses have been retrieved.
// Create a new NV container
pGMNV := GMW_NV_Create;
// Test if NV is valid
If pGMNV <> nil then
begin
// Load the NVs to create the contact record
GMW_NV_SetValue(pGMNV, 'Company', 'FrontRange Solutions');
GMW_NV_SetValue(pGMNV, 'Contact', 'Nelson Fernandez');
GMW_NV_SetValue(pGMNV, 'Phone1', '(310)555-1212');
GMW_NV_SetValue(pGMNV, 'Email', '[email protected]');
GMW_NV_SetValue(pGMNV, 'WebSite', 'www.gm.com');
else
// Display Error
ShowMessage('Could not create NV container.');
Enumerating a Container
The following example assumes that GMXS32.DLL has already been loaded and
function addresses have been retrieved.
// Determine the number of returned values
lCount := GMW_NV_Count(pGMNV);
427
Integrating With GoldMine
DataStream
The following example assumes that GMXS32.DLL has already been loaded and
function addresses have been retrieved.
iHandle:=GMW_DS_RANGE('Contsupp', 'Contspfd', 'PE-MAIL ADDRESS',
'PE-MAIL ADDRESS~', 'ContSupRef;', PChar('''' +
UpperCase(cebMatchValue.Text)+''' $ Upper(ContSupRef)'), '',
#13+#10);
If iHandle > 0 then
Begin
bDone :=FALSE
Repeat
//Fetch Data
lres:=GMW_DS_Fetch(iHandle, pcBuffer, iBufSize, 0);
if lres>0 then //Fetch Successfully?
begin
//Get results
sResults:=sResults + Copy(StrPas(pcBuffer),12,iBufSize-12);
FreeMem(pcBuffer, iBufSize); //Free buffer memory
end;
until bDone
lres:=GMW_DS_Close(iHandle);
end;
428
Integrating With GoldMine
429
General Index
Activities adding contacts to ............................... 281
creating or updating ........................... 271 creating ................................................. 280
AddContactGrpMembers................. 281–83 Contact Groups
AddContactGrpMembers function ....... 281 retrieving names of contact groups .. 288
AddFolder function................................. 306 contact information
Alert accessing, using Open, Move, or Read
attaching an alert to the specified ..................................................... 47, 193
contact record .................................. 286 accessing, using RecordObj ......... 47, 193
returning alerts attached to a contact contact record
record................................................ 285 creating or updating an additional.. 267,
returning all defined alerts ................ 286 276, 277, 278
API linking contact records to an accounting
logging in multiple users ..................... 97 application ......................................... 30
Append function................................ 33, 182 Contact Record
AttachTrack function .............................. 279 adding a record............................ 124, 156
Automated Process.................................. 279 attaching an alert to the specified
retrieving the default contact contact record .................................. 286
automated process .......................... 291 attaching an automated process........ 279
BDE session creating or updating ........................... 264
closing ............................................... 95, 96 creating or updating a referral .... 270–71
loading .............................................. 92, 93 deleting the current record ........ 125, 157
Boolean operator...................................... 365 evaluating an Xbase expression on a
BR4............................................................... 25 contact record .................................. 289
Business Logic Methods reading a Contact1 or Contact2 record
accessing ............................................... 106 ........................................................... 284
comparing methodology to that of retrieving the default contact
GM5S32.DLL ..................................... 90 automated process .......................... 291
using to simplify procedures............. 263 returning alerts attached to a contact
working with ....................................... 263 record................................................ 285
C++ examples for GM5S32.DLL...... 409–15 updating notes of a primary contact
CAL.DBF............................................. 378–79 record................................................ 266
SQL........................................................ 394 CONTACT1.DBF ............................... 379–81
Xbase ..................................................... 378 SQL........................................................ 395
CalComplete function ....................... 52, 199 Xbase ..................................................... 379
Calendar CONTACT2.DBF
completing an activity .................... 52–54 SQL........................................................ 398
deleting Calendar items ..................... 292 Xbase ..................................................... 382
CallerID function ............................... 54, 201 ContactLogin function ............................ 318
Close function .................................... 34, 182 CONTGRPS.DBF
code examples SQL........................................................ 399
for GM5S32.DLL............................ 409–29 Xbase ..................................................... 383
conditionals .............................................. 365 CONTHIST.DBF
contact group SQL........................................................ 400
431
Integrating With GoldMine
432
Integrating With GoldMine
433
Integrating With GoldMine
434
Integrating With GoldMine
435
Integrating With GoldMine
436
Integrating With GoldMine
Security table
handling GoldMine Security ............. 293 checking for an Xbase or SQL table type
reading security and rights for a DLL ..................................................... 37, 184
user............................................ 113, 223 moving to the last record ........... 132, 167
retrieving field-level access rights .... 295 TemplateList function............................. 308
retrieving security access ................... 294 templates, accessing e-mail templates .. 308
validating a Web user name and third-party developers.................... 377, 393
password .......................................... 318 timestamps
seek converting TLog ............................ 76, 220
moving to the first record match...... 129, TLog import file
162 importing a prepared TLog import file
seeking a record........................... 133, 168 ........................................... 136, 172, 222
SendPage function............................. 75, 219 TLog timestamps
service item......................................... 77, 225 converting to date and time stamps ... 77
service name ............................................... 30 UNLOCK function .................................. 191
service topics ................................ 30, 59, 208 UpdateEmailAddress function.............. 265
SetContactAlert function ........................ 286 UpdateMail function ............................... 302
SetEmailPrefs function............................ 313 UpdateWebSite function ........................ 266
SetSessionHandling function................. 263 user
SPFILES.DBF creating a new GoldMine login......... 293
SQL........................................................ 406 generating a remote license file......... 296
Xbase ..................................................... 391 logging in multiple users through the
SQL API ...................................................... 97
determining whether a table is SQL or reading security and rights for a DLL
Xbase......................................... 124, 156 User........................................... 113, 223
executing a query ................................ 279 removing a remote license ................. 297
setting the database login name and retrieving field-level access rights .... 295
password ............................................ 91 retrieving security access ................... 294
table, checking for ......................... 37, 184 returning a user list............................. 287
SQL database structures ................. 391–407 returning group memberships for a
SQLStream function ................................ 279 specified user................................... 288
status bar validating a Web user name and
message display..................................... 76 password.......................................... 318
StatusMsg function.................................... 76 user group
Summary tab ...................................... 83, 232 returning a user group member list . 287
support and resources returning group memberships for a
developers FTP site ............................... 24 specified User .................................. 288
GoldMine KnowledgeBase .................. 24 saving a user group............................. 288
sync log VBA ....................................................... 31, 32
updating sync logs with GM5S32.DLL visible fields, retrieving .......................... 295
................................................... 135, 171 Visual Basic examples for GM5S32.DLL
updating the Sync Log file . 135, 171, 221 ......................................................... 416–23
sync stamp Visual Basic for Applications................... 31
converting to time format .......... 138, 173 Web
synchronization functions .............. 135, 171 validating a Web user name and
SyncStamp function .......................... 76, 220 password.......................................... 318
System Agent ..................................... 75, 219
437
Integrating With GoldMine
Web import instruction file, processing 59, conditionals, operators, and logical
208 evaluators ........................................ 364
Web site record,updating....................... 266 creating an Xbase file with registered
Work Area fields ........................................... 62, 210
accessing low-level data using work date functions .............................. 368, 372
areas.......................................... 121, 153 determining whether a table is SQL or
in DDE functions................................... 31 Xbase ........................................ 124, 156
WriteContact function ............................ 264 evaluating an Xbase expression on a
WriteContactNotes function.................. 266 contact record.................................. 289
WriteDetail function ............................... 268 expression, reading without opening a
WriteGMUser function........................... 293 file ............................................... 59, 208
WriteGroupUsersList function.............. 288 function/parameter types ................. 364
WriteHistory function ............................ 275 functions............................................... 368
WriteLinkedDoc function ...................... 269 miscellaneous functions............. 368, 376
WriteOtherContact function..267, 276, 277, numeric functions ....................... 368, 374
278 string functions ................................... 368
WriteReferral function............................ 270 table, checking for......................... 37, 184
WriteSchedule function.......................... 271 Xbase database structures.................377–91
Xbase Xbase expressions ..............................363–76
XbaseContactExpr function ................... 289
438