ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Contact functions (Lotus Notes or Android/iPhone/iPad)
  • Special case
  • Required permissions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a contact:
  • WINDEVWEBDEV - Server codeReports and Queries in a Lotus Notes or Outlook address book.
    Caution: This function does not add a contact to the address book of an Outlook Express mailbox.
  • AndroidAndroid Widget iPhone/iPad from the list of contacts on the device (Android, iPhone or iPad).
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax
// Initialisation des variables de la structure Contact
ContactReset()
// Renseignements des variables pour le nouveau contact
mContact.Name = "Dupont"
mContact.FirstName = "Axelle"
mContact.Email = "axelle.dupont@mesmails.com"
// Ajout du contact
IF ContactAdd(IDSession) = True THEN
	Info("Contact ajouté")
ELSE
	Error("Erreur lors de l'ajout", ErrorInfo())
END
AndroidAndroid Widget iPhone/iPad
// Variables locales
tContact is Contact
tTéléphone is Phone

// Identité
tContact.Name = SAI_Nom
tContact.FirstName = SAI_Prénom

// Numéros de téléphone Fixe
IF SAI_TéléphoneFixe <> "" THEN
	tTéléphone.Number = SAI_TéléphoneFixe
	tTéléphone.Type = phoneHome
	Add(tContact.PhoneNumber, tTéléphone)
END

// Ajout
IF NOT ContactAdd(tContact, gSource) THEN
	Error("Impossible de créer le contact.")
ELSE
	FEN_TableContacts.RafraichitListeContact()
	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.
AndroidAndroid 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
AndroidAndroid Widget iPhone/iPad

Special case

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

Required permissions

This function changes the permissions required by the application.
Permission required: WRITE_CONTACTS
This permission allows the application to write (without reading) the data of the user 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: 09/24/2024

Send a report | Local help