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.
Create a Transaction object with the following attributes:
Customer
{
CustomerId*
CustomerName
CustomerLastName
}
Apply the Work With pattern to it.
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:
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:
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.
Finally, go to the Layout tab and insert in the Application Bar a button associated with the 'AddToContact' event.