Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
Addressbook.record.SetValueForProperty
Sets the value of a given property for a record.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| Addressbook | 3.1 | Yes | No | No | No | Yes |
Deprecated
This function was deprecated. Use Contacts functions instead.
Parameters
| Parameter | Description | Example |
|---|---|---|
| RecordID | The unique ID for the target person or group. | $personID |
| PropertyName | The name of the property. | "EmailProperty" |
| Value | The value as text, date or number. | $value |
Result
Returns OK on success and error on failure.
Description
Sets the value of a given property for a record.For multivalue items, please use an empty string as value and the plugin will put in the current multivalue.
Possible property names are UIDProperty, CreationDateProperty, ModificationDateProperty, FirstNameProperty, LastNameProperty, FirstNamePhoneticProperty, LastNamePhoneticProperty, NicknameProperty, MaidenNameProperty, BirthdayProperty, BirthdayComponentsProperty, OrganizationProperty, JobTitleProperty, HomePageProperty, URLsProperty, CalendarURIsProperty, EmailProperty, AddressProperty, OtherDatesProperty, OtherDateComponentsProperty, RelatedNamesProperty, DepartmentProperty, PhoneProperty, AIMInstantProperty, JabberInstantProperty, MSNInstantProperty, YahooInstantProperty, ICQInstantProperty, InstantMessageProperty, SocialProfileProperty, NoteProperty, MiddleNameProperty, MiddleNamePhoneticProperty, TitleProperty, SuffixProperty and GroupNameProperty.
Examples
Set first name on a person:
MBS( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; Addressbook::FirstName )
Add a new URL to a contact:
Set Variable [$r; MBS( "Addressbook.multivalue.New") ]
Set Variable [$ID; MBS( "Addressbook.multivalue.addValue"; "http://www.mbsplugins.de"; "WorkLabel" ) ]
Set Variable [$r; MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $ID ) ]
Set Variabel [$r; MBS( "Addressbook.record.SetValueForProperty"; $personID; "URLsProperty"; "multivalue" ) ]
Add work and home emails:
$r = MBS( "Addressbook.multivalue.New" )
$WorkEmailID = MBS( "Addressbook.multivalue.addValue"; Addressbook::WorkEmail; "EmailWorkLabel" )
$HomeEmailID = MBS( "Addressbook.multivalue.addValue"; Addressbook::HomeEmail; "EmailHomeLabel" )
$r = MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $WorkEmailID )
$r = MBS( "Addressbook.record.SetValueForProperty"; $personID; "EmailProperty"; "multivalue" )
Set flags, so entry shows as company:
MBS( "Addressbook.record.SetValueForProperty"; $personID; "PersonFlags"; 1 )
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" )
Replace an email:
# find my ID
Set Variable [$personID; Value:MBS( "Addressbook.me" )]
# get email list
Set Variable [$r; Value:MBS( "Addressbook.record.valueForProperty"; $personID; "EmailProperty" )]
# show first email in list
Set Variable [$firstValue; Value:MBS( "Addressbook.multivalue.valueAtIndex"; 0 )]
Show Custom Dialog ["First Email"; $firstValue]
# replace first email with new email
Set Variable [$r; Value:MBS( "Addressbook.multivalue.replaceValueAtIndex"; 0; "test@test.test" )]
# show changed email
Set Variable [$firstValue; Value:MBS( "Addressbook.multivalue.valueAtIndex"; 0 )]
Show Custom Dialog ["First Email"; $firstValue]
# set back the email list
Set Variable [$r; Value:MBS( "Addressbook.record.SetValueForProperty"; $personID; "EmailProperty"; "" )]
# save it
Set Variable [$r; Value:MBS( "Addressbook.save" )]
Show Custom Dialog ["Saved"; $r]
Add first and last name:
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; $vn )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "LastNameProperty"; $nn )]
Set organization:
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "OrganizationProperty"; $org )]
Add homepage URLs:
# add homepages
Set Variable [ $r ; Value: MBS( "Addressbook.multivalue.New" ) ]
Set Variable [ $Blog_URL_ID ; Value: MBS( "Addressbook.multivalue.addValue"; "http://www.mbs-plugins.com/"; "Blog" ) ]
Set Variable [ $Homepage_URL_ID ; Value: MBS( "Addressbook.multivalue.addValue"; "http://www.monkeybreadsoftware.de/"; "HomePageLabel" ) ]
Set Variable [ $r ; Value: MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $Homepage_URL_ID ) ]
Set Variable [ $r ; Value: MBS( "Addressbook.record.SetValueForProperty"; $personID; "URLsProperty"; "multivalue" ) ]
See also
- Addressbook.addRecord
- Addressbook.me
- Addressbook.multivalue.addValue
- Addressbook.multivalue.New
- Addressbook.multivalue.setPrimaryIdentifier
- Addressbook.multivalue.valueAtIndex
- Addressbook.NewGroup
- Addressbook.NewPerson
- Addressbook.record.UniqueID
- Addressbook.record.valueForProperty
Example Databases
Blog Entries
- Store your ID in URLs in Mac address book
- MBS FileMaker Plugin, version 8.2pr6
- Filemaker and the Mac OS X Addressbook
Release notes
- Version 8.2
- Improved Addressbook.record.SetValueForProperty to better handle keeping the record current.
Created 18th August 2014, last changed 9th March 2018
Addressbook.personFromVCardTextRepresentation - Addressbook.record.UniqueID
Feedback: Report problem or ask question.
Links
MBS Xojo Chart Plugins