Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   8.6    Statistic  

CNContactStore.NewContact

Creates new empty contact.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Contacts 8.4 Yes No No No Yes
MBS( "CNContactStore.NewContact" )   More

Parameters

none

Result

Returns contact identifier or error.

Description

Creates new empty contact.
Please use later CNContactStore.AddContact to store changes.

Examples

Create a contact:

Set Variable [ $contactID ; Value: MBS( "CNContactStore.NewContact") ]
Set Variable [ $r ; Value: MBS( "CNContact.SetValue"; $contactID; "givenName"; "Joe" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.SetValue"; $contactID; "familyName"; "Miller" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.SetValue"; $contactID; "jobTitle"; "Family Manager" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.SetValue"; $contactID; "organization"; "Family" ) ]
#
#
Set Variable [ $image ; Value: MBS( "Container.ReadFile"; "/Library/Desktop Pictures/Lion.jpg") ]
Set Variable [ $r ; Value: MBS( "CNContact.SetValue"; $contactID; "imageData"; $image ) ]
#
Set Variable [ $r ; Value: MBS( "CNContact.AddEmailAddress"; $contactID; "test@test.test"; "Work" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.AddInstantMessage"; $contactID; "instantTest"; "Facebook"; "Work" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.AddURLAddress"; $contactID; "http://www.monkeybreadsoftware.com/"; "Homepage" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.AddSocialProfile"; $contactID; "Home"; "http://www.facebook.com"; "testSocial"; ""; "Facebook" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.AddRelation"; $contactID; "Jane Miller"; "Sister" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.AddPhoneNumber"; $contactID; "123 456 789"; "iPhone" ) ]
Set Variable [ $r ; Value: MBS( "CNContact.AddPostalAddress"; $contactID; "Home"; "Main Street 123"; "New City"; "NS"; "12345"; "USA"; "US" ) ]
#
Set Variable [ $contactID ; Value: MBS( "CNContactStore.AddContact"; $contactID) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to create a contact" ; $r ]
Else
    Set Field [ Contacts::ContactID ; $contactID ]
    Set Variable [ $json ; Value: MBS( "CNContact.JSON"; $contactID) ]
    Set Variable [ $json ; Value: MBS("JSON.Colorize"; MBS( "JSON.Format"; $json) ) ]
    Set Field [ Contacts::Result ; $json ]
End If

See also

Example Databases

Created 2nd August 2018, last changed 6th August 2018


CNContactStore.GroupsInContainer   -   CNContactStore.RemoveMember

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins