Answered by:
Is there a unique ID available for Contacts / How to query custom fields

Question
-
I wonder how my app can determine if the contact a user picker has already been picked before. Does the Contact app provide some custom field like an "id" or "uuid" for contacts it returns via the picker contract?Tuesday, November 6, 2012 12:22 PM
Answers
-
You would have to keep track of all the available fields and perhaps create a concatenated key from them. Then you could do a very simple lookup to determine if it was selected before.
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Monday, November 12, 2012 1:22 PM
- Marked as answer by Song Tian Tuesday, November 13, 2012 6:52 AM
Monday, November 12, 2012 1:22 PMModerator
All replies
-
Hi Phil,
I am not sure about the Contact app (I don't have such an app on my system), but you can see for yourself if an contact has custom fields. If it does the size will be > 0. For example, I connected to the People app and found it has no custom fields by using the immediate windows after fetching a contact:?contact.customFields
{...}
[Methods]: {...}
size: 0x0
You of course could do whatever you want in the customerFields if you have your own provider.-Jeff
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, November 8, 2012 3:03 PM
Thursday, November 8, 2012 3:03 PMModerator -
I know, it does not have such fields. I even debugged it and looked through its source. It seems there is a personId property when you request "Windows.Live.Chat" custom property fields but I could not get it to work.
The problem with this is, that I want to allow the user to pick contacts over and over again. How could I determine if a picked contract was already picked before?
Thursday, November 8, 2012 3:05 PM -
You would have to keep track of all the available fields and perhaps create a concatenated key from them. Then you could do a very simple lookup to determine if it was selected before.
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Monday, November 12, 2012 1:22 PM
- Marked as answer by Song Tian Tuesday, November 13, 2012 6:52 AM
Monday, November 12, 2012 1:22 PMModerator