| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
Addressbook.multivalue.setPrimaryIdentifier
Sets the primary value to be the value for the given identifier.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| Addressbook | 3.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
Deprecated
This function was deprecated. Use Contacts functions instead.
MBS( "Addressbook.multivalue.setPrimaryIdentifier"; Identifier ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| Identifier | The identifier whose value will be used as the primary value for a multivalue property. | $identifier |
Result
Returns OK on success and error on failure.
Description
Sets the primary value to be the value for the given identifier.If the identifier is empty, this method returns an error. Use the Addressbook.multivalue.identifierAtIndex method to get the identifier given the index.
Examples
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 Variable [$r; MBS( "Addressbook.record.SetValueForProperty"; $personID; "URLsProperty"; "multivalue" ) ]
Set Variable [$ID; MBS( "Addressbook.multivalue.addValue"; "http://www.mbsplugins.de"; "WorkLabel" ) ]
Set Variable [$r; MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $ID ) ]
Set Variable [$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" )
$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" )
See also
- Addressbook.multivalue.addValue
- Addressbook.multivalue.identifierAtIndex
- Addressbook.multivalue.indexForIdentifier
- Addressbook.multivalue.labelForIdentifier
- Addressbook.multivalue.New
- Addressbook.multivalue.primaryIdentifier
- Addressbook.multivalue.valueForIdentifier
- Addressbook.NewPerson
- Addressbook.record.SetValueForProperty
- Addressbook.save
Example Databases
This function is free to use.
Created 18th August 2014, last changed 6th September 2025
Addressbook.multivalue.replaceValueAtIndex - Addressbook.multivalue.valueAtIndex