Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

Addressbook.save

Saves all the changes made since the last save.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Addressbook 3.1 Yes No Yes, macOS only No Yes

MBS( "Addressbook.save" )

Parameters

none

Result

Returns OK on success and error on failure.

Description

Saves all the changes made since the last save.

Examples

Create person and save changes:

$personID = MBS( "Addressbook.NewPerson" )
$r = MBS( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; "John" )
$r = MBS( "Addressbook.addRecord"; $personID )
$r = MBS( "Addressbook.save" )

Edit existing person:

# get an UUID for a person record
$personID = "637FA922-7A2B-4F9A-BFA3-023253D4A3D5:ABPerson"
# set a new name
$r = MBS( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; "John" )
# save it
$r = MBS( "Addressbook.save" )

Add a new person to addressbook.

# Fields to variables
#
Set Variable [$vn; Value:Adressen::Extra]
Set Variable [$nn; Value:Adressen::Nachname]
Set Variable [$org; Value:Adressen::Name]
Set Variable [$str; Value:Adressen::Straße]
Set Variable [$land; Value:Adressen::Land]
Set Variable [$plz; Value:Adressen::PLZ]
Set Variable [$ort; Value:Adressen::Stadt]
Set Variable [$email; Value:Adressen::EMail]
Set Variable [$tel; Value:Adressen::Tel]
Set Variable [$mob; Value:Adressen::Mobil]
#
# Create new person
#
Set Variable [$personID; Value:MBS ( "Addressbook.NewPerson" )]
# Add first name
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; $vn )]
# Add last name
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "LastNameProperty"; $nn )]
# Organization
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "OrganizationProperty"; $org )]
# Add one address
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.New"; 1 )
Set Variable [$id; Value:MBS ( "Addressbook.multivalue.addAddress"; $str; $plz; $ort; $land; ""; "" )]
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.setPrimaryIdentifier"; $id )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "AddressProperty"; "multivalue" )]
# add an email
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.New")
Set Variable [$id; Value:MBS ( "Addressbook.multivalue.addValue"; $email; "EmailWorkLabel" )]
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.setPrimaryIdentifier"; $id )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "EmailProperty"; "multivalue" )]
# Add phone numbers
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.New"]
Set Variable [$tel_id; Value:MBS ( "Addressbook.multivalue.addValue"; $tel; "PhoneWorkLabel" )]
Set Variable [$mob_id; Value:MBS ( "Addressbook.multivalue.addValue"; $mob; "PhoneMobileLabel" )]
Set Variable [$result; Value:MBS ( "Addressbook.multivalue.setPrimaryIdentifier"; $mob_id )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "PhoneProperty"; "multivalue" )]
#
# Save record
Set Variable [$result; Value:MBS ( "Addressbook.addRecord"; $personID )]
Set Variable [$result; Value:MBS ( "Addressbook.save" )]

See also

Example Databases


Addressbook.removeRecord   -   Addressbook.searchElementForConjunction

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins