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.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

Addressbook.multivalue.replaceValueAtIndex

Replaces the value at the given index.

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

MBS( "Addressbook.multivalue.replaceValueAtIndex"; index; value )

Parameters

Parameter Description Example value
index The index of the value that will be replaced. $index
value The new value. $value

Result

Returns OK on success and error on failure.

Description

Replaces the value at the given index.

Examples

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]

See also


Addressbook.multivalue.replaceLabelAtIndex   -   Addressbook.multivalue.setPrimaryIdentifier

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins