Page 1 of 1

Can't get mobileGetContactData(contactID) to work

Posted: Sat Jun 30, 2012 10:32 pm
by olieolson
Always returns empty. Anyone having any luck with this?

mobilefind, mobilepick and mobileAdd all work for me. I want to be able to query the current record and update if needed.

Here's the test script I'm using:


on mouseUp
mobileShowContact field "contactIDFld"
put mobileGetContactData( field "contactIDFld") into resultThang
if resultThang is empty then
put "Whoops" into field "searchresults"
else
put resultThang into field "searchresults"
end if

end mouseUp


Thanks in advance!!

Olie

Re: Can't get mobileGetContactData(contactID) to work

Posted: Sat Jun 30, 2012 10:53 pm
by sturgis
From the dictionary entry:
Value:
An array of key/data entries for the specified user ID

If no contact could be found, then no array is returned.
Use a test like: "if the result is an array" to determine if contact information was returned. "if the result is empty" will always be empty, even if data is returned in an array.

Re: Can't get mobileGetContactData(contactID) to work

Posted: Sun Jul 01, 2012 12:17 am
by Dixie
Olie..

try something like this...

Code: Select all

on mouseUp
   put mobileGetContactData(1) into theData[contact]
   put theData[contact]["firstname"] & cr after red
   put theData[contact]["lastname"] & cr after red
   put red into fld 1
end mouseUp
be well,

Dixie

Re: Can't get mobileGetContactData(contactID) to work

Posted: Sun Jul 01, 2012 1:11 am
by olieolson
Dixie,

Thanks! That works like a charm. I'm a little emabaressed that I didn't see that myself...

You're awesome!

Donald