Official Content

The purpose of this article is to explain how to use the AddContact method offered by the Contacts external object for adding a contact through a Native Mobile app.

Step 1

Create a Transaction object with the following attributes:

Customer
{
  CustomerId*
  CustomerName
  CustomerLastName
}

Step 2

Apply the Work With pattern to it.

Step 3

Using the AddContact method you will be able to add a contact through the app to be stored in the device.

The method expects the following parameters:

AddContactMethodFromContactsEO

Note: FirstName and LastName are mandatory. Email and Phone are optional.

In the Work With tab, go to the Section (General) node located under the Detail node:

RemoveContactMethod-WW-Detail-SectionGeneral-Events

Define the following event in the Events tab:

Event 'AddToContacts'
     AddressBook.AddContact(PersonName, PersonLastName, PersonEmail, PersonPhone, CompanyName, '' , PersonMessage)
Endevent

Note: The parameters that are not used must be included in the call of the method anyway.

Step 4

Finally, go to the Layout tab and insert in the Application Bar a button associated with the 'AddToContact' event.

WW-Detail-SectionGeneral-Layout-AppBar-InsertButton

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