PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Special case
  • Required permissions
  • Required application feature
  • Syntax that is using the Contact structure (before Android 2.0)
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 into the address book of a Lotus Notes or Outlook messaging.
    Caution: This function cannot be used to add a contact into the address book of an Outlook Express messaging.
  • Versions 16 and later
    Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad into the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    New in version 16
    Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad into the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad into the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
Versions 16 and later
Android This function is now available for Android applications.
New in version 16
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 18
Android Widget This function is now available in Android widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Android Widget This function is now available in Android widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 22 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 22
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
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
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad
// Variables locales
tContact is Contact
tTéléphone is Phone
 
// Identité
tContact.LastName = 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 the details of the error, use ErrorInfo with the errMessage constant.
<Session identifier>: Integer
Identifier of session to use. This identifier is returned by EmailStartNotesSession, EmailStartOutlookSession, NotesOpenDatabase or OutlookStartSession.
Versions 17 and later
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Adding a contact into the list of contacts on the device (from Android 2.0, iPhone or iPad, Universal Windows) Hide the details

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

Adding a contact into the list of contacts on the device (from Android 2.0, iPhone or iPad, Universal Windows) Hide the details

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

Adding a contact into the list of contacts on the device (from Android 2.0, iPhone or iPad, Universal Windows) Hide the details

<Result> = ContactAdd(<Contact> [, <Source>])
<Result>: Boolean
  • True if the addition was performed,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Contact>: Contact variable
Name of the Variable of type Contact corresponding to the Contact to be added.
<Source>: Optional ContactSource variable
Name of the Variable of type ContactSource corresponding to the source or account to which the Contact is to be added. If this parameter is not specified, the contact will be associated with no account.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad
Versions 16 and later
Warning
From version 17 (69), this syntax is kept for backward compatibility.
New in version 16
Warning
From version 17 (69), this syntax is kept for backward compatibility.
Warning
From version 17 (69), this syntax is kept for backward compatibility.

Adding a contact into the list of contacts on the device (before Android 2.0, iPhone or iPad, Universal Windows) Hide the details

<Result> = ContactAdd(<Type of contact>)
<Result>: Boolean
  • True if the addition was performed,
  • False otherwise. To find out the wording of the error, use the function ErrorInfo with the constant errMessage.
<Type of contact>: Integer constant
Type of contact to add. By default, this parameter corresponds to the contactPhone constant.
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.
Versions 16 and later
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.
New in version 16
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.
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.
Versions 22 and later
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.
New in version 22
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.
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.
Versions 16 and later
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Syntax that is using the Contact structure (before Android 2.0)

Only the following members of the Contact structure will be taken into account when adding the contact:
  • mContact.Name
    The name of the contact on the device will be built from the mContact.Name and mContact.FirstName members.
  • mContact.FirstName
    The name of the contact on the device will be built from the mContact.Name and mContact.FirstName members.
  • mContact.Notes
  • mContact.HomeAddress
    The home address of the contact on the device will be built from the mContact.HomeAddress, mContact.HomeCity, mContact.HomeZip, mContact.HomeState and mContact.HomeCountry members.
  • mContact.HomeCity
  • mContact.HomeZipCode
  • mContact.HomeState
  • mContact.HomeCountry
  • mContact.HomePhone
  • mContact.HomeFax
  • mContact.MobilePhone
  • mContact.Company
  • mContact.Department
  • mContact.OfficeAddress
    The business address of the contact on the device will be built from the mContact.OfficeAddress, mContact.OfficeCity, mContact.OfficeZip, mContact.OfficeState and mContact.OfficeCountry members.
  • mContact.OfficeCity
  • mContact.OfficeZipCode
  • mContact.OfficeState
  • mContact.OfficeCountry
  • mContact.OfficePhone
  • mContact.OfficeFax
  • mContact.OfficeMobilePhone
  • mContact.OfficePager
  • mContact.Email
New in version 16
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Syntax that is using the Contact structure (before Android 2.0)

Only the following members of the Contact structure will be taken into account when adding the contact:
  • mContact.Name
    The name of the contact on the device will be built from the mContact.Name and mContact.FirstName members.
  • mContact.FirstName
    The name of the contact on the device will be built from the mContact.Name and mContact.FirstName members.
  • mContact.Notes
  • mContact.HomeAddress
    The home address of the contact on the device will be built from the mContact.HomeAddress, mContact.HomeCity, mContact.HomeZip, mContact.HomeState and mContact.HomeCountry members.
  • mContact.HomeCity
  • mContact.HomeZipCode
  • mContact.HomeState
  • mContact.HomeCountry
  • mContact.HomePhone
  • mContact.HomeFax
  • mContact.MobilePhone
  • mContact.Company
  • mContact.Department
  • mContact.OfficeAddress
    The business address of the contact on the device will be built from the mContact.OfficeAddress, mContact.OfficeCity, mContact.OfficeZip, mContact.OfficeState and mContact.OfficeCountry members.
  • mContact.OfficeCity
  • mContact.OfficeZipCode
  • mContact.OfficeState
  • mContact.OfficeCountry
  • mContact.OfficePhone
  • mContact.OfficeFax
  • mContact.OfficeMobilePhone
  • mContact.OfficePager
  • mContact.Email
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad

Syntax that is using the Contact structure (before Android 2.0)

Only the following members of the Contact structure will be taken into account when adding the contact:
  • mContact.Name
    The name of the contact on the device will be built from the mContact.Name and mContact.FirstName members.
  • mContact.FirstName
    The name of the contact on the device will be built from the mContact.Name and mContact.FirstName members.
  • mContact.Notes
  • mContact.HomeAddress
    The home address of the contact on the device will be built from the mContact.HomeAddress, mContact.HomeCity, mContact.HomeZip, mContact.HomeState and mContact.HomeCountry members.
  • mContact.HomeCity
  • mContact.HomeZipCode
  • mContact.HomeState
  • mContact.HomeCountry
  • mContact.HomePhone
  • mContact.HomeFax
  • mContact.MobilePhone
  • mContact.Company
  • mContact.Department
  • mContact.OfficeAddress
    The business address of the contact on the device will be built from the mContact.OfficeAddress, mContact.OfficeCity, mContact.OfficeZip, mContact.OfficeState and mContact.OfficeCountry members.
  • mContact.OfficeCity
  • mContact.OfficeZipCode
  • mContact.OfficeState
  • mContact.OfficeCountry
  • mContact.OfficePhone
  • mContact.OfficeFax
  • mContact.OfficeMobilePhone
  • mContact.OfficePager
  • mContact.Email
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: wd270com.dll
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment