Get Contact Data

To get contact data, you must first use the PB_CONTACT_LOADACTIVE command to load the contact.

PB_CONTACT_LOADACTIVE

Loads the active contact in the current search result, if any. Use PB_SR_INDEX to check that a contact is selected.

PB_CONTACT_GETEID StringVarOut

Sets StringVarOut to the ID number of the currently selected contact.

PB_CONTACT_GETNAME_BYPART [TitleOut], [FirstOut], [MiddleOut], [LastOut], [PostOut], [NickOut], [CompanyOut]

Where variables are given, this will return the requested contact data. When parameters are left out, trailing commas are not necessary.

Example:

PB_CONTACT_GETNAME_BYPART ,First,,Last

PB_CONTACT_GETNAME_FORMAT StringVarOut, FormatType

Sets StringVarOut to the name formatted based on FormatType:

0: Full Name

1: First + Last

2: Title + First + Last

3: Last + comma + First

If FormatType is invalid, this returns "".

PB_CONTACT_GETMAILING StringVarOut

Sets StringVarOut to the formatted mailing address. This includes the name and address (including position) for the contact's mailing address. Blank lines are removed. Trailing blank lines are removed.

Basically, this returns Full Name + Company + Dept + Street1 + Street2 + CityStateZip + Country

PB_CONTACT_GETCOUNTS [AddressCount], [PhoneCount], [EmailCount], [WebCount]

Sets the given variables to the number of public addresses, phones, emails, websites. When variables are left out, trailing commas are not necessary. (See the example under PB_CONTACT_GETNAME_BYPART.)

PB_CONTACT_GETADDRESS_BYPART index, [TypeOut], [PositionOut], [CompanyOut], [DeptOut], [Street1Out], [Street2Out], [CityOut], [StateOut], [ZipOut], [CountryOut], [CountyOut]

Where variables are given, this will return the requested contact data for the given zero-based index. When variables are left out, trailing commas are not necessary. (See the example under PB_CONTACT_GETNAME_BYPART.)

PB_CONTACT_GETADDRESS_FORMAT index, StringVarOut, FormatType

Sets StringVarOut to the formatted address for the given zero-based index and FormatType. Blank lines are removed. Trailing blank lines are removed. The following are the values for FormatType:

0: Company + Dept + Street1 + Street2 + CityStateZip + Country

1: Street1 + Street2 + CityStateZip + Country

2: Street1 + Street2 + CityStateZip

3: Position + Company + Dept + Street1 + Street2 + CityStateZip + Country

4: Type + Position + Company + Dept + Street1 + Street2 + CityStateZip + Country + County

PB_CONTACT_GETPHONE_BYPART index, [TypeOut], [CountryOut], [AreaOut], [PhoneOut], [ExtOut]

Where variables are given, this will return the requested contact data for the given zero-based index. When variables are left out, trailing commas are not necessary. (See the example under PB_CONTACT_GETNAME_BYPART.)

PB_CONTACT_GETPHONE_FORMAT index, StringVarOut, FormatType

Sets StringVarOut to the formatted phone for the given zero-based index and FormatType.

0: "Type " + "[Country] " + "(Area) " + Phone + " x" + Ext (note the spaces)

1: "[Country] " + "(Area) " + Phone + " x" + Ext (note the spaces)

2: (Area) + Phone

3: Area + "-" + Phone

4: Area + Phone (dashes and spaces removed)

5: Phone (dashes and spaces removed)

PB_CONTACT_GETEMAIL_BYPART index, [TypeOut], [AddressOut]

Where variables are given, this will return the requested contact data for the given zero-based index. When variables are left out, trailing commas are not necessary. (See the example under PB_CONTACT_GETNAME_BYPART.)

PB_CONTACT_GETWEB_BYPART index, [TypeOut], [AddressOut]

Where variables are given, this will return the requested contact data for the given zero-based index. When variables are left out, trailing commas are not necessary. (See the example under PB_CONTACT_GETNAME_BYPART.)

PB_CONTACT_GETADDRESSINDEX_BYTYPE ReturnInt, ListString, SepString, CompareInt, InstanceInt

Finds an address type that matches a value in the list of strings (ListString where each item in the list is separated by the first character of SepString).

InstanceInt: if <= 1 then it finds the first match, otherwise it finds the InstanceInt match.

To get the first address with a blank type use:

PB_CONTACT_GETADDRESSINDEX_BYTYPE ReturnInt, "",";", 0, 1

ReturnInt: Returns -1 if a match is not found, otherwise it returns the index (zero based) of the found address.

CompareInt: This defines how to compare the type with each item in the list. All compares are case-insensitive.

      • 0: The type exactly matches an item in the list (case-insenstive)
      • 1: The type starts with an item in the list (case-insensitive)
      • 2: The type contains an item in the list (case-insensitive)
      • 3: The type ends with an item in the list (case-insensitive)

PB_CONTACT_GETPHONEINDEX_BYTYPE ReturnInt, ListString, SepString, CompareInt, InstanceInt

Finds a phone number type that matches a value in the list of strings (ListString where each item in the list is separated by the first character of SepString).

InstanceInt: if <= 1 then it finds the first match, otherwise it finds the InstanceInt match.

To get the first phone number with a blank type use:

PB_CONTACT_GETPHONEINDEX_BYTYPE ReturnInt, "",";", 0, 1

ReturnInt: Returns -1 if a match is not found, otherwise it returns the index (zero based) of the found phone number.

CompareInt: This defines how to compare the type with each item in the list. All compares are case-insensitive.

      • 0: The type exactly matches an item in the list (case-insenstive)
      • 1: The type starts with an item in the list (case-insensitive)
      • 2: The type contains an item in the list (case-insensitive)
      • 3: The type ends with an item in the list (case-insensitive)
© 1991-2024 - Baseline Data Systems, Inc.