GoldMine Application Programming Interface Specification and Reference



Download 465.93 Kb.
Page1/4
Date31.01.2017
Size465.93 Kb.
#14243
  1   2   3   4

GoldMine Application Programming Interface

Specification and Reference

Copyright1999 GoldMine Software Corporation

­­­­­­­­­­­­­­________________________________________­­­______________________________________________

Authors: Elan Susser

Nelson Fernandez

Nigel Bassel

Kim Novins
Product: GoldMine

Product Version: 5.0


Created: May 15, 1999

Last Updated: November 9, 1999



Table of Contents

Table of Contents 2

Introduction 6

Business Logic Explained 6

GM5S32.DLL - Loading and Logging In 8

GMW_LoadBDE 8

GMW_UnloadBDE 8

GMW_SetSQLUserPass 8

GM5S32.DLL - Name/Value Functions 9

Introduction 9

GMW_NV_Create 9

GMW_NV_CreateCopy 9

GMW_NV_Copy 9

GMW_NV_Delete 9

GMW_NV_GetValue 10

GMW_NV_SetValue 10

GMW_NV_NameExists 10

GMW_NV_EraseName 10

GMW_NV_EraseAll 11

GMW_NV_Count 11

GMW_NV_GetNameFromIndex 11

GMW_NV_GetValueFromIndex 11

GMW_NV_SetStr 12

GMW_Execute 12

Business Logic Methods 13

Introduction 13

WriteContact 13

WriteContactNotes 13

WriteOtherContact 13

WriteDetail 14

WriteLinkedDoc 14

WriteReferral 15

WriteSchedule 15

WriteHistory 16

AttachTrack 16

SQLStream 16

ReadRecord 17

ReadContact 17

GetContactAlerts 17

SetContactAlerts 18

GetAllAlerts 18

GetUsersList 18

GetGroupUsersList 19

GetUserMemberships 19

WriteGroupUsersList 19

IsContactCurtained 19

SendGMEmail 20

ContactLogin 20

GM5S32.DLL – Security Information Functions 21

Introduction 21

GMW_UserAccess 21

GMW_CalAccess 21

GMW_HistAccess 22

GMW_GetLicenseInfo 22

GMW_IsUserGroupMember 22

GM5S32.DLL – DataStream Functions 23

Introduction 23

Advantages of using DataStream 23

DataStream Record Selection 23

GMW_DS_Range 24

GMW_DS_Query 24

GMW_DS_Fetch 24

GMW_DS_Fetch’s Return Packet Explained 25

GMW_DS_Close 25

GM5S32.DLL - Low-Level access using Work Areas 27

Introduction 27

Opening/Closing databases 28

GMW_DB_Open 28

GMW_DB_Close 28

GMW_DB_IsSQL 28

Creating and Deleting Records 29

GMW_DB_Append 29

GMW_DB_Delete 29

Reading/Writing Data 30

GMW_DB_Read 30

GMW_DB_RecNo 30

GMW_DB_Replace 30

GMW_DB_Unlock 30

Limiting scope of data 32

GMW_DB_Filter 32

GMW_DB_Range 32

Searching for data 33

GMW_DB_Search 33

GMW_DB_Seek 33

GMW_DB_SetOrder 33

Navigating the database 34

GMW_DB_Move 34

GMW_DB_Goto 34

GMW_DB_Top 35

GMW_DB_Skip 35

GMW_DB_Bottom 35

Quick Functions 36

GMW_DB_QuickSeek 36

GMW_DB_QuickRead 36

GMW_DB_QuickReplace 36

GM5S32.DLL - Updating Sync Logs 38

GMW_UpdateSyncLog 38

GMW_ReadImpTLog 38

GMW_NewRecID 39

GMW_SyncStamp 39

GM5 COM Object 40

Introduction 40

The Object Model 40

The Application class. 41

Properties 41

SystemFolder 41

GoldmineFolder 41

CommonFolder 41

GMUserName 41

GMPassword 41

SQLUserName 41

SQLPassword 41

LicenseInfo 42

Methods 42

Login 42


Logout 42

NewContainer 42

Execute 42

NewWorkArea 42

The Container class. 42

Properties 42

Count 42

_NewEnum 42

Add 42

Remove 42



Methods 42

Item 42


CopyFrom 43

Copy 43


The Name/Value Pair Class 43

Properties 43

Count 43

Name 43


_NewEnum 43

Methods 43

Add 43

Item 43


The WorkArea Class 43

Methods 43

Append 43

Replace 43

Delete 43

Unlock 43

Read 43

Top 44


Bottom 44

SetOrder 44

Seek 44

Skip 44


Goto 44

Move 44


Search 44

Filter 44

Range 44

RecNo 44


IsSQL 44

The LicenseInfo Class 44

Properties 44

Licensee 44

LicenseNumber 44

SiteName 44

LicensedUsers 44

LicensedSQLUsers 45

LicensedGoldSyncSites 45

IsDemo 45

IsPrimaryLicense 45

IsRemoteLicense 45

IsUSALicense 45

DLLVersion 45

Code Examples - GM5S32.DLL 46

C++ 46


Visual Basic 54

Delphi 62

Code Examples - GM5 COM Object 70

C++ 70


VB/VBScript 71

JScript 72

Delphi 76

Introduction

GoldMine’s GM5S32.DLL is a standard dynamic-link library (DLL) that offers developers efficient methods to both access GoldMine’s databases, and to update GoldMine’s synchronization logs when external applications update GoldMine data. Most development environments can load GM5S32.DLL. GoldMine does not need to run to use GM5S32.DLL.
GM5S32.DLL installs into the \WINDOWS\SYSTEM directory automatically with GoldMine 5.0. Therefore, third-party developers do not need to distribute GM5S32.DLL with their applications.

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.goldminesw.com/newsgroups.


This document contains the information you need to:


  • Load and initialize GM5S32.DLL

  • Use of the new Business Logic functions

  • Work with DataStream functions

  • Work with low-level data access functions

  • Update GoldMine synchronization information when data is changed by an external application



Business Logic Explained

GoldMine 5 introduces a new concept for people wishing to develop integrated products with GoldMine. We call this “Business Logic”. Business Logic transactions are commonly used procedures wrapped into a single call. For example to attach a new profile to a record you simple execute the WriteProfile function.


In order to make these Business Logic methods useful, there must be a way to pass multiple parameters to the various methods. To accomplish this GoldMine provides a set of functions to control Name/Value containers. All Business Logic functions rely on a Name/Value container to hold the multiple parameters and return values.
The GoldMine API allows you to call these functions from the GM5S32.DLL or a GM COM object.
Name/Values Containers

Name/Values - or NVs - are simply a ‘Name’ and a ‘Value combination. You can equate a Name/Value to the following example:


Company=GoldMine Software Corporation
‘Company’ is the Name and ‘GoldMine Software Corporation’ is the Value.
Using a set of NV pairs provides an easy mechanism to pass multiple parameters to a function. By allowing the user to populate the NV pairs into a set or ‘container’, and then executes a Business Logic transaction against the set. The transaction will then add extra pairs to the container to return the results.
Since the NV container remains in memory until you clear it, it can be used to make several calls without clearing all the previous values. This would be useful when you want to call the same function with only slight changes to the values such as scheduling a recurring activity or when a return value of one call is needed for a subsequent call.
The Business Logic methods allow the programmer to easily read and write GoldMine data. In the past one had to be very familiar with the schema and methodology of GoldMine databases in order to integrate with GoldMine. The new Business Logic functions ease this burden and provide a more standardized and safe way to integrate with GoldMine. Business Logic functions wrap several other low-level calls to perform common tasks. We can compare an example flow to a common task using both methods:
Method 1, updating a contact record using the GM5S32.DLL or DDE:

Step 1 – Open the Contact1 database

Step 2 – Set the index tag

Step 3 – Seek the record

Step 4 – If not found then Append a new record

Step 5 – Replace field values

Step 6 – Close the database
Method 2, updating a contact record using the Business Logic Methods:

Step 1 – Load an NV Container with the values for the contact record

Step 2 – Execute the ‘WriteContact’ method.
This is a basic example but you can see how much simpler Method 2 would be compared to Method 1.






GM5S32.DLL - Loading and Logging In

The following section describes the functions available for the programmer to Load the BDE and login to a GoldMine table. You can refer to section “Code Examples - GM5S32.DLL” for function prototypes and code examples in C++, Visual Basic and Delphi.
GMW_LoadBDE

Loads the BDE. GMW_LoadBDE must be called before calling any function that accesses databases, such as GMW_DB_Read and GMW_DS_Query. GMW_UnloadBDE must be called before unloading the DLL.


Syntax: GMW_LoadBDE( <szSysDir>, <szGoldDir>, <szCommonDir>, <szUser>, <szPassword> )

Parameters: <szSysDir> specifies the location of LICENSE.DBF.



<szGoldDir> specifies the location of CAL.DBF.

<szCommonDir> specifies the location of CONTACT1.DBF.

<szUser> specifies the GoldMine user name (must be UPPERCASE).

<szPassword> specifies the user’s password (must be UPPERCASE).
Returns: 1 Success

0 BDE already loaded

-1 BDE failed to load

-2 LICENSE table not found in SysDir

-3 Cannot load LICENSE table

-4 Invalid username and/or password

-5 CAL table not found in GoldDir

-6 CONTACT1 table not found in CommonDir


GMW_UnloadBDE

Unloads the BDE. If GMW_LoadBDE is called, GMW_UnloadBDE must be called before unloading the DLL.


Syntax: GMW_UnloadBDE
Returns: 1 Success

0 Failure


GMW_SetSQLUserPass

SQL only. GMW_SetSQLUserPass should be called immediately prior to the GMW_LoadBDE call. GMW_SetSQLUserPass is required only when accessing SQL tables and will have no affect on dBase tables.


Syntax: GMW_SetSQLUserPass( <szUserName>, <szPassword> )
Parameters: <szUserName> specifies the SQL login name.

<szPassword> specifies the password for SQL login name.
Returns: 1 Success

0 Failure


GM5S32.DLL - Name/Value Functions

Introduction

The following section describes the functions available for the programmer to manipulate Name Value containers. You can refer to section “Code Examples - GM5S32.DLL” (page 43) for function prototypes and code examples in C++, Visual Basic and Delphi.


Note: These functions require that you are successfully logged into a GoldMine database using the GMW_LoadBDE function.
GMW_NV_Create

This function creates a pointer to a new NV container.


Syntax: GMW_NV_Create()
Example: pGMNV := GMW_NV_Create;
Returns: Pointer to a new NV container.

GMW_NV_CreateCopy

Creates a new NV container and and copies the values from an existing NV container.
Syntax: GMW_NV_CreateCopy( )

Pointer to the source NV container.
Example: pGMNV2 := GMW_NV_CreateCopy(pGMNV);
Return: Pointer to a new NV container.

GMW_NV_Copy

Copies the values from one NV container to another. GMW_NV_Create or GMW_NV_CreateCopy must have previously created both NV containers.
Syntax: GMW_NV_Copy( , )
Pointer to the destination container.

Pointer to the source container.
Example: GMW_NV_Copy(pGMNV2, pGMNV);
Return: n/a

GMW_NV_Delete

Deletes an NV container and releases it’s memory. Be sure to call this for all previously created containers before exiting your application.

Syntax: GMW_NV_Delete( )



pointer to the NV container to delete.
Example: GMW_NV_Delete(pGMNV);
Return: n/a

GMW_NV_GetValue

Reads a value stored in an NV container. If the name does not exit in the container the default value is returned.
Syntax: GMW_NV_GetValue( , , )
pointer to a valid name value container

name of the value to return

default value if is null or does not exist.
Example: sValue := GMW_NV_GetValue(pGMNV, ‘Phone1’, ‘(none)’);

Returns: The value of the is returned. If the is null or does not exist then the value is returned.

GMW_NV_SetValue

Stores a name value pair in the specified container.


Syntax: GMW_NV_SetValue( , , )
pointer to a valid name value container

name of the value to set

value to assign to .
Example: GMW_NV_SetValue(pGMNV, ‘Phone1’, ‘(310)555-1212’);
Return: n/a

GMW_NV_NameExists

Checks if the specified Name Value exists within the NV container.
Syntax: GMW_NV_NameExists( , )
pointer to a valid name value container

name of the value to set
Example: iResult := GMW_NV_NameExists(pGMNV, ‘Phone1’);

Return: 0 – Value does not exist in container

1 – Value exists in container

GMW_NV_EraseName

Remove a Name Value pair from the spcified container
Syntax: GMW_NV_EraseName( , )
pointer to a valid name value container

name of the value to set

Example: GMW_NV_EraseName(pGMNV, ‘Phone1’)

Return: n/a

GMW_NV_EraseAll

Removes all Name Value pairs from the specified container
Syntax: GMW_NV_EraseAll( )
pointer to a valid name value container
Example: GMW_NV_EraseAll(pGMNV);
Return: n/a
GMW_NV_Count

Returns the number of Name Value pairs within the specified container.

Syntax: GMW_NV_Count( )
pointer to a valid name value container
Example: iCount := GMW_NV_Count( pGMNV);
Return: number of NVs within the specified container

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: GMW_NV_GetNameFromIndex( , )

pointer to a valid name value container

the item number to return
Example: sName := GMW_NV_GetNameFromIndex(pGMNV, 3);
Return: The name stored at within the container.

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: GMW_NV_GetValueFromIndex( , , )

pointer to a valid name value container

the item number to return

the default value to return if the specified item is null.
Example: sValue := GMW_NV_GetValueFromIndex(pGMNV, 3, ‘Customer’);
Return: The value stored at within the container.

GMW_NV_SetStr

Sets one or more name value pairs
Syntax: GMW_NV_SetStr( , , , )
pointer to a valid name value container.

the delimiter between the name and its value. *

the delimiter between each NV pairs. *

String containing the name values.
* The delimiters may be the same.
Example: GMW_NV_SetStr(pGMNV,‘=’,‘;’,‘Company=GoldMine;Key1=Cust’);

GMW_NV_SetStr(pGMNV,‘&’,‘&’,‘Company&GoldMine&Key1&Cust’);


Return: n/a

GMW_Execute

All of the business logic methods are accessed through the GMW_Execute function. You must be successfully logged into a GoldMine database for this call to work properly. See page 13 for a list of valid business logic methods
Syntax: GMW_Execute( , )

one of the various business logic functions described below.

pointer to a Name Value container.
Example: GMW_Execute(“WriteContact”, pGMNV);

Returns: 0 – failure

>0 – success

Business Logic Methods

Introduction

This section describes the business logic methods available to the programmer. These methods must be called from either the GMW_Execute function (GM5S32.DLL) or the Execute method of the GM COM object.

WriteContact

Updates or creates a new Contact record. If RecID is passed as null then a new record will be created, otherwise the record will be updated.

Required NVs: None
Optional NVs: Any valid Contact1 or Contact2 field.
Special NVs: Email E-mail Address profile value

WebSite Web Site profile value

NonUSAPhone Int'l phone format is used if NonUSAPhone = 1, Default is 0

WebUserName Web username to assign to this contact. See ContactLogin for more information.

WebPassword Web password to assign to this contact. See ContactLogin for more information.

Output NVs: RecID If new record created.



AccountNo AccountNo of the record

WriteContactNotes

Updates a Note for a primary contact record. 'Appends' to the top of the note with the proper header information. If both AccountNo and RecID are passed, only AccountNo will be used. The Note header will use the current date/time and default to the logged in username.
Required NVs: Notes The note text to add

AccountNo AccountNo of the Contact1 record to add notes to. This NV is not required if RecID is used

RecID RecID of the contact1 record to add the notes to. This NV is not required if AccountNo is used.
Optional NVs: UserID UserID used in the note header
Output NVs: None

WriteOtherContact

Creates or updates an additional contact record. I f RecID is null then a new record will be created, otherwise the record will be updated. When RecID is passed as null, an AccountNo should be passed otherwise an unlinked record will be created
Required NVs: None
Optional NVs: RecID RecID of the record to update. If null, a new record will be created.

AccountNo AccountNo of linked Contact1 record.

Contact Contact name

Title Title

Ref Reference

Dear Salutation

Phone Phone number

Fax Fax number

Ext Extension

Address1 Address Line 1

Address2 Address Line 2

City City

State State

Zip Zip code

Country Country

Notes Notes

LinkAcct Link Account RecID
Special NVs: Email Email address of the additional contact

NonUSAPhone Set to ‘1’ for a non USA phone format

UseMergeCodes Set to ‘1’ if you wish to set the ‘Use Merge Codes’ option

MergeCodes Merge codes
Output NVs: RecID Returns the new RecNo or RecID if a new record was created.

WriteDetail

Creates or updates a detail record. If RecID is null then a new record will be created, otherwise the record will be updated. When a RecID is passed as null to create a new record, an AccountNo should be passed otherwise an unlinked record will be created.
Required NVs: Detail The name of the detail.
Optional NVs: RecID RecID of the record to update. If null, a new record will be created.

AccountNo AccountNo of linked Contact1 record.

Ref Value of the detail being created or updated

Notes Notes for the detail record.
Special NVs: These fields correspond to the extended detail fields.

UField1

UField2

UField3

UField4

UField5

UField6

UField7

UField8
Output NVs: RecID Returns the new RecNo if a new record was created.

WriteLinkedDoc

Creates or updates a linked document record. If RecID is null then a new record will be created, otherwise the record will be updated. When RecID is passed as null, an AccountNo should be passed otherwise an unlinked record will be created
Required NVs: RecID RecID of the record to update. If null, a new record will be created.
Optional NVs: AccountNo AccountNo of linked Contact1 record.

FileName Full path and filename

Ref Title of the document.

Notes Notes
Special NVs: SyncFile If set to 1, the file will be synched with remote sites.
Output NVs: RecID Returns the new RecNo if a new Record was created.

WriteReferral

Creates or updates a referral from one contact record to another.
Required NVs: RecID RecID of the record to update. If null, a new record will be created.
Optional NVs: FromAccNo AccountNo of the ‘From’ referral

ToAccNo AccountNo of the ‘To’ referral.

FromRef Reference line for the ‘From’ record.

ToRef Reference line for the ‘To’ record.

Notes Notes

AppendNotes Appends Notes with a timestamp. You must pass a valid RecID.

Special NVs: OppSummary 12 bit flag of opportunity summary checkboxes in the Referrals properties. This is a sequence of 12 "1"s or "0"s


Output NVs: RecID Returns the new RecNo if a new Record was created.

WriteSchedule

Creates or updates a scheduled activity record. If RecID is null then a new record will be created, otherwise the record will be updated. When RecID is passed as null, an AccountNo should be passed otherwise an unlinked record will be created
Required NVs: RecID RecID of the record to update. If null, a new record will be created.
Optional NVs: AccountNo AccountNo of linked Contact1 record.

RecType RecType. For a list of valid RecTypes, see the table structures for CAL.

UserID User name of activity

Contact Contact name

Ref Reference: line

Notes Notes

ActvCode Activity code

OnDate Date of activity.

OnTime Time of activity.

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 for this to be used.

AlarmTime Time of alarm. Must set Alarm to 1 for this to be used.

Special NVs: RSVP If set to 1, the activity will be sent with an RSVP. Default is 0.



Private If set to 1, the acivity 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’

Output NVs: RecID Returns the new RecID if a new Record was created.

WriteHistory

Creates/updates a history record, or completes a scheduled activity record. If RecID is null then a new record will be created, otherwise the record will be updated. When RecID is passed as null, an AccountNo should be passed otherwise an unlinked record will be created. To complete a scheduled activity you must pass CalRecID.


Required NVs: RecID RecID of the record to update. If null, a new record will be created.
Optional NVs: AccountNo AccountNo of linked Contact1 record.

RecType RecType. For a list of valid RecTypes, see the table structures for CONTHIST.

UserID User name of activity

Contact Contact name

Ref Reference line

Notes Notes

ActvCode Activity code

ResultCode Result code

OnDate Date of activity.

OnTime Time of activity.

Duration Duration of activity
Special NVs: CalRecID RecID of the scheduled activity (Cal table)

Success If set to 1, the activity was successful. Default is 1.

Private If set to 1, the activity is marked as private. Default is 0.

RSVP If set to 1, an RSVP is scheduled. Default is 0.

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 Numer of units in sale. Used where RecType = ‘S’
Output NVs: RecID Returns the new RecNo if a new record was created.

AttachTrack

Attaches an automated process to a contact record
Required NVs: AccountNo AccountNo of the contact record (Contact1) to attach with.

Track

UserID
Output NVs: RecID

SQLStream

Executes an SQL and returns the data in a DataStream. See documentation for DataStream for more information.


Required NVs: SQL SQL Statement to execute.

Optional NVs: Filter xBase filter expression.



FldDlm Field delimiter. Defaults to CR.

RecDlm Record delimiter. Defaults to LF.

StartRec Starting record. Defaults to 1

GetRecs Maximum records to return. Defaults to 100

MaxBufSize Maximum buffer size. Defaults to 32k
Output NVs: Output Return DataStream.

ReadRecord

Reads a record from the specified table based on RecID. When the TableName=Contact1, all Contact2 fields will also be returned.
Required NVs: TableName The GoldMine table to read from.

RecID The RecID of the Contact1 record to return.
Optional NVs: AddressBlock When equal to 1, the address will return as one block of text instead of in seperate fields for Address1, Address2, City, State, etc...
Special NVs: AccountNo If TableName=Contact1 this can be used to find the record in place of

RecID
Output NVs: All field values for the specified record.



Email If TableName=Contact1 the primary email address will return

Website If TableName=Contact1 the website profile will return

ReadContact

Reads a contact record from Contact1 and Contact2.
Required NVs: RecID The RecID of the Contact1 record to return.
Optional NVs: AddressBlock When equal to 1, the address will return as one block of text instead of in seperate fields for Address1, Address2, City, State, etc...
Special NVs: AccountNo This can be used to find the record in place of RecID
Output NVs: All Contact1 and Contact2 field values.

Email If TableName=Contact1 the primary email address will return

Website If TableName=Contact1 the website profile will return

GetContactAlerts

Returns all alerts attached to a contact.

Required NVs: One of the following:



RecID The RecID of the Contact1 record. You may optionally use AccountNo.

AccountNo The AccoutnNo of the Contact1 record. You may optionally use RecID.
Output NVs: The function returns the number of contact alerts in the AlertsCount name value. For each alert the functionreturns five fields. Each set of alert fields has the alert number appended to the field name (represented by X below):

AlertsCount Number of alerts

CodeX 3 character alert code

DescX 80 character description

NotesX 64k of RTF alert message (optional)

CreatorX The user that assigned the alert

SaveHist A value of "1" indicates that GoldMine will save a history record when the user acknowledges the alert.

SetContactAlerts

Attaches an Alert to the specified contact record. An Alert list is available by executing the GetAllAlerts function

Required NVs: RecID The RecID of the Contact1 record to attach this alert to. You may optionally use AccountNo.



AccountNo The AccoutnNo of the Contact1 record. You may optionally use RecID.

Code 3 character Alert Code

Creator Creator of the Alert

SaveHist If set to ‘1’ then a history record is generated each time the Alert is acknowledged.
Output NVs: None.
The GMW_Execute function will return the following values:
0 - Contact not found

1 - Alert is added.

2 - Alert is already attached.

GetAllAlerts

Returns all alerts defined within GoldMine
Required NVs: None
Output NVs: The function returns the number of contact alerts in the AlertsCount name value. For each alert the function returns five fields. Each set of alert fields has the alert number appended to the field name (represented by X below):

AlertsCount Number of alerts

CodeX 3 character alert code

DescX 80 character description

NotesX 64k of RTF alert message (optional)

GetUsersList

Returns a list of all GoldMine users.
Required NVs: None
Output NVs: UserList Comma delimited list of all usernames

UserCount The number of users in the list.

UserGroupsList Comma delimited list of user groups

UserGroupsCount The number of user groups
The GMW_Execute function will return the same value as UserCount.

GetGroupUsersList

Returns a list of all members of a GoldMine user group.
Required NVs: GroupNo The user group number. See the GetUsersList or GetUserMemberships functions for information on how to retrieve a UserGroupsList and their numbers
Output NVs: UserList Comma delimited list of all usernames

UserCount The number of users in the list.
The GMW_Execute function will return the same value as UserCount.

GetUserMemberships

Returns a list of all user group memberships for the specified UserID.
Required NVs: UserID The GoldMine user name.
Output NVs: UserGroupsList Comma delimited list of user group numbers that the user is a member of.

UseGroupsCount The number of users in the list.
The GMW_Execute function will return the same value as UserGroupsCount.

WriteGroupUsersList

Saves the user members to a user group.
Required NVs: GroupNo The user group number. See the GetUsersList or GetUserMemberships functions for information on how to retrieve a UserGroupList and their numbers

UserList A comma separated list of users that are members of the specified group.
Output NVs: UserCount The number of updated user records.
The GMW_Execute function will return the same value as UserCount.

Note that this function requires a Master Rights login.

IsContactCurtained

Tests a contact record for curtaining.


Required NVs: RecID This is the RecID of the Contact1 record to test. AccountNo can be passed in place of this NV.

AccountNo This is the AccountNo of the Contact1 record to test. RecID can be passed in place of this NV.
Output NVs: Curtain Value can be one of the following:

0 - not curtained

1 - partial curtaining

2 - fully curtained.


The GMW_Execute function will return TRUE if the record was found.
SendGMEmail

Sends an email to a GoldMine user attached to a specific contact. This function wraps the WriteSchedule function, automatically passing a RecType of 'M'


Required NVs: UserID Recipients username

Subject Subject line of email

BodyText Body of message

AccountNo AccountNo of the contact record (Contact1) to attach with.

Optional NVs: Since this function wraps the WriteSchedule API function, all parameters accepted by WriteSchedule can also be passed.


Special NVs: Since this function wraps the WriteSchedule API function, all parameters accepted by WriteSchedule can also be passed.
Output NVs: RecID Returns the new RecID if a new Record was created.

ContactLogin

Validates a WebUserName/WebPassword assigned to a contact.
Required NVs: UserName Contact's Web username.

Password Contact's Web Password.
Special NVs: NewUserName Used to change the existing web username. Must be used with NewPassword and a valid UserName/Password must also be passed for verification.

NewPassword Used to change the existing web password. Must be used with NewUserName and a valid UserName/Password must also be passed for verification.

Output NVs: AccountNo Returns the AccountNo of the contact record.



RecID Returns the RecID for the contact record.
Notes: This function is useful for those wishing to write an extranet solution for GoldMine. To enable GUI access to these features, set ContWebAccess=1 under the [GoldMine] section of your user.ini. You can then select Edit>record Properties>WebAccess to set the web user/pass (max 15 characters each). The web access info is stored in ContSupp with a RecType of "W". Username and password must be unique. This information does NOT sync.

GM5S32.DLL – Security Information Functions

Introduction

The following section describes the functions available for the programmer to request various security levels for the logged in user.


Note: These functions require that you are successfully logged into a GoldMine database using the GMW_LoadBDE function.
GMW_UserAccess

This function allows you to query various rights assigned to the user.


Syntax: GMW_UserAccess()
Parameters: The right you wish to query. Possible values are:
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
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 new 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

Returns: 1 User has that right.



  1. User does not have that right.

GMW_CalAccess

Using this function you can query if the logged in user has the rights to access a specific type of CAL table record.
Syntax: GMW_CalAccess(<szRecType>, <szUserID>, <szNumber1>)
Parameters: <szRecType> The RecType you wish to query.

<szUserID> The GoldMine user name associated with the record.

<szNumber1> The value of the Number1 field of the record.
Returns: 1 User has the right to access the record


  1. User does NOT have the right to access the record.

GMW_HistAccess

Using this function you can query if the user logged in via the DLL has rights to access a CONTHIST record.
Syntax: GMW_HistAccess( <szRecType>, <szUserID> )
Parameters: <szRecType> The RecType of the record

<szUserID> The GoldMine username associated with the record.
Returns: 1 User has the right to access the record.

0 User does not have the right to access the record.


GMW_GetLicenseInfo

This function will return various information about the GoldMine license being used.


Syntax: GMW_GetLicenseInfo( <pLicInfo>)
Parameters: <pLicInfo> Pointer to a client allocated structure defined as follows:


Type/Size

Name

Description

char / 60

Licensee

Licensee name

char / 20

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

long integer

DLLVersion

DLL Version number

long integer

Reserved1

Reserved

long integer

Reserved2

Reserved

char / 100

sReserved

Resreved

Returns: 1 Success

0 Failure
GMW_IsUserGroupMember

Test for group membership. Passing the group number achieves faster performance since the group number need not be resolved from the group name.


Syntax: GMW_IsUserGroupMember( <szGroup>, <szUserID> )


Parameters: <szGroup> The Group name or Group Number

<szUserID> The GoldMine username
Returns: 1 User belongs to the group

0 User does not belong to the group



GM5S32.DLL – DataStream Functions

Introduction

DataStream returns the data of ordered records from any GoldMine table using the most efficient method available. The caller can specify:




  • Fields and expressions to return

  • Range of records to return

  • Optional filter to apply to the data set

DataStream’s SQL query capabilities are very fast on SQL databases.


The DataStream method allows for many useful applications. One such group of applications could merge HTML templates with the data returned by GoldMine’s DataStream to publish the contents of GoldMine data on the Internet. 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, including dealer addresses in a particular city, financial numbers stored in Contact2, and even seating availability at upcoming conferences. With a fast Internet connection and a strong SQL server, the GoldMine client could respond simultaneously to dozens of requests.
Advantages of using DataStream

GoldMine’s DataStream is absolutely the fastest way to read data from GoldMine tables! Used correctly, DataStream will return the data faster than most development environments would directly. DataStream offers the following advantages:
Efficiency: DataStream issues a single, most efficient SQL query or dBASE seek to retrieve 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, greatly minimizing network traffic.
Speed: All fields and expressions are parsed initially by GMW_DS_Range() and GMW_DS_Query(), then quickly evaluated against each record in GMW_DS_Fetch. Other DDE methods (and development environments) require that each field be parsed and evaluated each time its data is read. This makes a big difference when reading hundreds or thousands of records.
Simplicity: Only three function 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 function calls).
Results: All the work to gather and format the data is done in C++, which is the fastest way to fly. The caller needs only to parse the resulting packet string.
DataStream Record Selection

The following DataStream functions are listed in the order in which they must be called.


GMW_DS_Range(): opens a ranged cursor

GMW_DS_Query(): opens an SQL query cursor

GMW_DS_Fetch(): fetches records

GMW_DS_Close(): closes cursor
Note that either the GMW_DS_Range() function or the GMW_DS_Query() function must be called first to request the data. These functions return an integer handle which must be passed to the GMW_DS_Fetch() and GMW_DS_Close() functions.
You must use either GMW_DS_Range() or GMW_DS_Query()—you cannot use both. The GMW_DS_Range and GMW_DS_Query functions execute equally fast on SQL databases. GMW_DS_Range executes much faster on dBASE tables than GMW_DS_Query.
GMW_DS_Range

GMW_DS_Range returns a range of records based on an index.


Syntax: GMW_DS_Range( <szTable>, <szTag>, <szTopLimit>, <szBotLimit>, <szFields>, <szFilter>, <szFDlm>, <szRDlm> )
Parameters: <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> The szFields parameter passed to GMW_DS_Range should consist of the field names and dBASE expressions to evaluate against each record in the data set. Each field must be terminated with a semicolon (;). dBASE expressions must be prefixed with an ampersand (&), and terminated with a semicolon. For example: “Company; Contact; Phone1; &Substr(Zip,1,5);”
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).
Returns: 1-20 Succesful handle

  1. Failure.

GMW_DS_Query

Returns a range of records based on an SQL query. This function is very fast on SQL databases.
Syntax: GMW_DS_Query( <szSQL>, <szFilter>, <szFDlm>, <szRDlm> )
Parameters: <szSQL> query sends the query for evaluation on the server. The SQL query can join multiple tables and return any number of fields.

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: 1-20 Succesful handle

0 Failure.

-1 Invalid SQL Query/Timeout
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(). This “fetch” command can be issued multiple times, with positive and negative values, to scroll down or up the cursor.


DataStream takes about as much time to read three records as to read 30. For best performance, adjust the number of records requested by GMW_DS_Fetch to return 8K–32K packets.
The calling application must allocate the memory for a large enough packet buffer, and pass that memory buffer to GMW_DS_Fetch. When the number of records cannot be estimated to allocate a packet buffer, GMW_DS_Fetch can be called twice, once to fetch the data and return a buffer size, and a second time to retrieve the data into the buffer. When GMW_DS_Fetch is first called to get the buffer size, the szBuf and iBufSize parameters must both be 0. The nGetRecs parameter must indicate the number of records to fetch. When GMW_DS_Fetch is then called to retrieve the data that has been fetch by the first call, the nGetRecs parameter must be 0. See “DataStream C++ Examples” (Example 2) on page 50.




Download 465.93 Kb.

Share with your friends:
  1   2   3   4




The database is protected by copyright ©ininet.org 2024
send message

    Main page