/ Forums / Advansys Formativ / Creating Solutions with Formativ / Filter in GroupWise Address Book for logged-in user / Reply To: Filter in GroupWise Address Book for logged-in user

#6868
Support 1
Participant

I am not sure why you get the error ‘Invalid procedure call…’ That line of code works fine for us (GroupWise 6.5.1). What version of the GroupWise client are you using?

Novell’s online documentation here notes the method AddressBookEntries.Find does not support the BEGINSWITH operator.

The properties of Address object GroupWise.Account.Owner are fixed (see the API documentation). The Object API knows nothing about admin-defined fields, so you cannot retrieve your FullName property in this way.

Below is a complete sample applet. Note that collections such as AddressBookEntries, Fields are 1-based (not zero-based, like VBScript arrays).

--------------------------------------------------------------------------------
' Displays a dialog, listing every field in the first
' address book entry matching the logged-in user.
sub Main(Client, GWEvent)

  dim iUserId
  dim iText
  dim oEntry
  dim oEntries
  dim oField
  dim oFields
  dim oAddressBook

  set oAddressBook = GroupWise.Account.AddressBooks.Item("Novell GroupWise Address Book")

  iUserId = Groupwise.EnvUserID()

  set oEntries = oAddressBook.AddressBookEntries.Find("(<E-Mail Address> CONTAINS """ & iUserId & """)")
  if oEntries is nothing then
    msgbox "oEntries is nothing. Quitting"
    exit sub
  end if

  set oEntry = oEntries.Item(1)
  set oFields = oEntry.Fields

  iText = ""
  for each oField in oFields
    iText = iText & "Name: " & oField.Name & ", Value: " & oField.Value & vbCrLf
  next

  msgbox iText

  set oField = nothing
  set oFields = nothing
  set oEntry = nothing
  set oEntries = nothing
  set oAddressBook = nothing

end sub
--------------------------------------------------------------------------------

Advansys Support