ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Contact functions (Lotus Notes or Android/iPhone/iPad)
  • Special case
  • Required permissions
  • Required application feature
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Adds a contact:
  • WINDEVWEBDEV - Server codeReports and Queries in a Lotus Notes or Outlook address book.
    Caution: This function cannot be used to add a contact to an Outlook Express address book.
  • Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad into the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax
// Initialize the variables of Contact structure
ContactReset()
// Fill the variables for the new contact
mContact.Name = "Smith"
mContact.FirstName = "Adriana"
mContact.Email = "adriana.smith@mycompany.com"
// Add the contact
IF ContactAdd(SessionID) = True THEN
Info("Contact added")
ELSE
Error("Error during the addition", ErrorInfo())
END
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad
// Local variables
tContact is Contact
tPhone is Phone
 
// Identity
tContact.Name = EDT_LastName
tContact.FirstName = EDT_FirstName
 
// Home phone numbers
IF EDT_HomePhone <> "" THEN
tPhone.PhoneNumber = EDT_HomePhone
tPhone.Type = phoneHome
Add(tContact.Phone, tPhone)
END
 
// Add
IF NOT ContactAdd(tContact, gSource) THEN
Error("Unable to create the contact.")
ELSE
WIN_TableContacts.RefreshContactList()
Close()
END
Syntax
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax

Adding a contact into the Lotus Notes or Outlook messaging Hide the details

<Result> = ContactAdd(<Session identifier>)
<Result>: Boolean
  • True if the addition was performed,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Session identifier>: Integer
Session ID to be used. This identifier is returned by EmailStartNotesSession, EmailStartOutlookSession, NotesOpenDatabase or OutlookStartSession.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Adding a contact to the device's contact list Hide the details

<Result> = ContactAdd(<Contact> [, <Source>])
<Result>: Boolean
  • True if the addition was performed,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Contact>: Contact variable
Name of the Contact variable corresponding to the contact to add.
<Source>: Optional ContactSource variable
Name of the ContactSource variable corresponding to the source or to the account into which the contact will be added. If this parameter is not specified, the contact will be associated with no account.
Remarks
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Special case

To display the New Contact window in the device's native Contacts application, use ContactCreate.
AndroidAndroid Widget

Required permissions

Calling this function changes the permissions required by the application.
Required permission: WRITE_CONTACTS
This permission allows the application to write (without reading) the data of the user contacts.
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.
Related Examples:
WM Managing Contacts Cross-platform examples (WINDEV Mobile): WM Managing Contacts
[ + ] This example presents the management of contacts for Android et iOS.
It is used o:
- list the contacts found on the phone
- call the contacts
- send SMSs to the contacts
- ...
Component: wd300com.dll
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/23/2023

Send a report | Local help