• Special cases
  • Creating a contact (without using the creation window)
  • Application in the background: Specific case from Android 10
  • Required application feature
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Displays the window for contact creation of the native application for contact management found on the device (Android, iPhone or iPad, Universal Windows).
AndroidAndroid Widget iPhone/iPad
// Create a contact and initialize the Contact structure
IF ContactCreate() = True THEN
Info(StringBuild("The contact %1 was added to your list of contacts: ", ...
AndroidAndroid Widget iPhone/iPad
gCurrentContact is Contact
garrContacts is array of Contact
// Create a contact in the default window
IF ContactCreate() = True THEN
// Refreshes the list of contacts displayed in a Looper control
nIndex is int = LOOP_CONTACTS
// List of contacts
garrContacts = ContactList()
// Sort the contacts
ArraySort(garrContacts, asMember, "+Name")
// Add into the looper
FOR EACH tContact OF garrContacts
LooperAddLine(LOOP_CONTACTS, tContact..LastName, tContact..FirstName)

Creating a contact and initializing the Contact variable Hide the details

<Result> = ContactCreate([<Contact>])
<Result>: Boolean
  • True if a contact was created,
  • False otherwise. To get more details on the error, use ErrorInfo.
Universal Windows 10 App
  • True if the user interface is displayed,
  • False otherwise.
<Contact>: Contact variable
Name of the Contact variable containing the data of the new contact.

Special cases

  • If the user creates a new contact, the Contact structure or the Contact variable is automatically populated with the details of this new contact.
  • AndroidAndroid Widget iPhone/iPad ContactCreate is a blocking function until the user validates or cancels the contact creation window.
  • Universal Windows 10 App ContactCreate is a non-blocking function.
  • ContactCreate can be used in the emulator. It cannot be used in the simulator.

Creating a contact (without using the creation window)

To create a new contact programmatically (without opening any window):
  1. Describe the contact using the Contact variable.
  2. Use the ContactAdd function.
AndroidAndroid Widget

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
ContactCreate can open a window. If this function is used while the application is in the background, a fatal error will occur.
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Contacts
This feature allows the applications to access the contacts.
Business / UI classification: Business Logic
Component: wd280android.aar
Minimum version required
  • Version 16
This page is also available for…
Click [Add] to post a comment