Official Content

The Contacts External Object enables you to programmatically manage the contacts on the device.

ContactsExternalObjectGX18_png

You can find the Contacts External Object in the KB Explorer within the SD module, which in turn is located within the GeneXus module. That is to say, it is part of the Smart Devices API.

Properties

It does not have any.

Methods

AddContact method

Adds a contact. Returns True if the operation was successful or the contact was already added. Returns False if any failure occurs and/or the user cancels the execution. If the returned value is not used, the event execution is canceled.

See HowTo: Use AddContact method from Contacts external object.

Return value Boolean
Parameters FirstName:Character(40), LastName:Character(40) [, Email:Email ] [, Phone:Phone ]
[, CompanyName: Character(40) ] [, Photo:URL ] [, Message:Character(80)]

RemoveContact method

Removes a contact. Returns True if the contact was removed successfully. Returns False if any failure such as the following occurs: the contact to be removed is not present in the catalog and/or the user cancels the execution. If the returned value is not used, the event execution is canceled.

See HowTo: Use RemoveContact method from Contacts external object.

Return value Boolean
Parameters FirstName:Character(40), LastName:Character(40) [, Email:Email[, Phone:Phone [, Message:Character(80)]

ViewContact method

Views the contact information stored in the device.

See HowTo: Use ViewContact method from Contacts external object.

Return value None
Parameters FirstName:Character(40), LastName:Character(40) [, Email:Email] [, Phone:Phone]

GetAllContacts method

Retrieves all the contacts' information from the device with their details.

Return value Collection( ContactInfo )
Parameters None

PickContact method

Opens the native platform's contact selection screen, allowing the end user to select a contact from the list available on the device. Execution is synchronous, pausing the program until the user selects a contact and closes the interface, allowing the execution to continue.

Return value ContactInfo
Parameters None

PickContacts method

Opens the native platform's contact selection screen, allowing the end user to select multiple contacts from the list available on the device. Execution is synchronous, pausing the program until the user selects a contact and closes the interface, allowing the execution to continue. On Android, because the native API only allows selecting one, this method will return at most a single contact.

Return value Collection(ContactInfo)
Parameters None

Events

It does not have any.

Structured Data Types

ContactInfo

Encapsulates single contact information stored in the device.

  • DisplayName:Character(80)
    Contains the name displayed on the device.
     
  • FirstName:Character(40)
    The contact's first name.
     
  • LastName:Character(40)
    The contact's last name.
     
  • Email:Email
    The contact's email.
     
  • Phone:Phone
    The contact's phone number.
     
  • CompanyName:Character(40)
    The contact's company name.
     
  • Photo:Image
    The contact's photo.
     
  • Notes:Character(200)
    Notes associated with the contact.

Samples

Event 'AddToContacts'
    &IsOK = Contacts.AddContact(PersonName,PersonLastName,PersonEmail,PersonPhone,CompanyName,PersonPhoto,PersonMessage)
Endevent
Event 'RemoveContact'
    &IsOK = Contacts.RemoveContact(PersonName,PersonLastName,PersonEmail,PersonPhone,PersonMessage)
Endevent
Event 'ViewContact'
    Contacts.ViewContact(PersonName,PersonLastName,PersonEmail,PersonPhone)
Endevent
Event 'ViewContactsList'
    &AddressBookContacts = Contacts.GetAllContacts()
Endevent

Scope

Generators: Android, Apple

Notes

   

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant