i
This is not the latest version of this document; to access the latest version, click here.
Official Content

The AddressBook API enables you to programmatically manage the AddressBook of the device.

AddressBookEO

Code Example

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

AddressBook Methods

AddContact

It is used to add a contact to the AddressBook. See HowTo: Use AddContact method from Contacts external object

Return value: Boolean

True if success. That means that the contact was added or was already in the AddressBook. False if any failure occurs or the user cancels the execution. If the return value is not used the event execution cancels.

Parameters:

FirstName, LastName, [Email], [Phone], [CompanyName], [Photo], [Message]

RemoveContact

It is used to remove a contact from the AddressBook. See HowTo: Use RemoveContact method from Contacts external object

Return value: Boolean 

True if success. That means that the contact was removed from the AddressBook. False if any failure occurs, the contact to be removed is not present in the AddressBook or the user cancels the execution. If the return value is not used the event execution cancels.

Parameters:

FirstName, LastName, [Email], [Phone], [Message]

ViewContact

It is used to view the contact information stored in the device. See HowTo: Use ViewContact method from Contacts external object

Return value: none

Parameters: FirstName, LastName, [Email], [Phone]

GetAllContacts

Retrieves all the contacts from the AddressBooks and returns the result in a collection of the predefined SDT SDTAddressBookContact.

Return value: collection of SDTAddressBookContact

Parameters: none.

Availability

GetAllContacts method is available for Android and iOS as of GeneXus X Evolution 3.
RemoveContact, and ViewContact are only available for iOS.

 




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