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.searchElementForProperty

Creates a new search element.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Addressbook 5.4 Yes No No No No

MBS( "Addressbook.searchElementForProperty"; Type; Property; Label; Key; Value; Comparison )

Parameters

Parameter Description Example value
Type Whether to make search element for group or person. Can be "Group" or "Person". "Person"
Property The name of the property to search on, such as ABAddressProperty or ABLastNameProperty. "LastNameProperty"
Label The label name for a multivalue list, such as kABAddressHomeLabel, kABPhoneWorkLabel, or a user-specified label, such as Summer Home. If the specified property does not have multiple values, pass "". If the specified property does have multiple values, pass "" to search all the values.
Key The key name for a dictionary, such as kABAddressCityKey or kABAddressStreetKey. If the specified property is not a dictionary, pass "". If the specified property is a dictionary, pass "" to search all keys.
Value What you’re searching for. If empty, then the only supported value for comparison is ABEqual or ABNotEqual.
Comparison The comparison operator. Can be Equal, NotEqual, LessThan, LessThanOrEqual, GreaterThan, GreaterThanOrEqual, EqualCaseInsensitive, ContainsSubString, ContainsSubStringCaseInsensitive, PrefixMatch, PrefixMatchCaseInsensitive, BitsInBitFieldMatch, DoesNotContainSubString, DoesNotContainSubStringCaseInsensitive, NotEqualCaseInsensitive, SuffixMatch, SuffixMatchCaseInsensitive, WithinIntervalAroundToday, WithinIntervalAroundTodayYearless, NotWithinIntervalAroundToday, NotWithinIntervalAroundTodayYearless, WithinIntervalFromToday, WithinIntervalFromTodayYearless, NotWithinIntervalFromToday or NotWithinIntervalFromTodayYearless. "Equal"

Result

Returns ID or error.

Description

Creates a new search element.
Returns a search element object that specifies a query for records of this type.

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

Find a person with first name being Christian:

Set Variable [$e1; Value:MBS( "Addressbook.searchElementForProperty"; "person"; "FirstNameProperty"; ""; ""; "Christian"; "Equal" )]
Set Variable [$records; Value:MBS( "Addressbook.recordsMatchingSearchElement"; $e1)]
Set Variable [$record; Value:GetValue($records; 1)]
Set Variable [$name; Value:MBS( "Addressbook.record.displayname"; $record )]
Show Custom Dialog [$name]

Search people with related name being John:

Set Variable [$e1; Value:MBS( "Addressbook.searchElementForProperty"; "person"; "RelatedNamesProperty"; ""; ""; "John"; "ContainsSubStringCaseInsensitive" )]
Set Variable [$records; Value:MBS( "Addressbook.recordsMatchingSearchElement"; $e1)]
Set Variable [$record; Value:GetValue($records; 1)]
Set Variable [$name; Value:MBS( "Addressbook.record.displayname"; $record )]
Show Custom Dialog [$name]

Find all companies:

# Companies have PersonFlags = 1 while normal people have 0.
Set Variable [$e; Value:MBS( "Addressbook.searchElementForProperty"; "person"; "PersonFlags"; ""; ""; 1; "Equal" )]
Set Variable [$records; Value:MBS( "Addressbook.recordsMatchingSearchElement"; $e)]
Set Variable [$record; Value:GetValue($records; 1)]
Set Variable [$name; Value:MBS( "Addressbook.record.displayname"; $record )]
Show Custom Dialog [$name]

See also


Addressbook.searchElementForConjunction   -   Addressbook.searchGroupsWithName

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins