Contact Creation Functions

Creating a new contact

You can use create, createName, createAddress, and createOrganization to add a new contact to the phonebook.

Method summary

Purpose

Method summary

Create Contact object with the given data.

create ()

  • Returns –  Contact Object
  • Params
    • name – String
    • phoneNumbaer – String
    • email - String    
    • save - boolean flag to indicate whether to save the contact or not.

Create ContactName object with the given data.

createName(String givenName, String familyname, String middleName, String formatted, String prefix, String suffix)

  • Returns - ContactName Object
  • Params
    • ContactName - represents Name for given contact
      • Fields available for contact
        • formatted
        • familyname
        • givenname
        • middlename
        • honorificprefix
        • honorificsuffix

 

Create ContactAddress object with the given data.

 

createAddress(String streetAddress, String locality, String region, String country, String postalCode, String formatted, String type, Boolean pref)

  • Returns - ContactAddress object
  • Params
    • streetAddress - String
    • locality – String
    • region – String
    • country – String
    • postalCode – String
    • formatted – String
    • type – String
    • pref - boolean flag to specify whether given contact field should be considered as preferred number

 

Create ContactOrganization object with the given data.

createOrganization(String name, String department, String title, String type, Boolean pref)

  • Returns - ContactOrganization object
  • Params
    • name - String
    • department – String
    • title – String
    • type – String
    • pref - boolean flag to specify whether given contact field should be considered as preferred number

 

Some examples

To create a Contact object:

<cfset contactobj = cfclient.contacts.create('user','123456789','user@adobe.com',true)>

To create a name:

<cfset cntname=cfclient.contacts.createName("Rob", "Cressey", "T", "Rob T Cressey", "Mr" , "Esq.")>

To create an address:

<cfset cntadr=cfclient.contacts.createAddress("First street", "North", "Indian", "India","12345", "Good address form", "home", "true")>

To create an organization:

<cfset cntorg=cfclient.contacts.createOrganization("SciTech", "Science", "Science Technology", "Education","true")>

 Adobe

Get help faster and easier

New user?