Garrett
Posts: 0
Joined: Sat Aug 17, 2013 12:18 pm

Trouble with PhoneGap Contact service. If a field is missing or blank, the code stops.

Very cool. I got it working properly.

For anyone out there in the same boat, I solved my issue by putting the following JS in the OnSuccess event of the Contact Service...

code
for (var i=0;i<data&#46;length;i++)
{

var phoneNumbers = data&#46;phoneNumbers;

Code: Select all

for (var j=0;j<phoneNumbers&#46;length;j++) 
 { 
   var type = phoneNumbers[j]&#46;type; 
   var phone = phoneNumbers[j]&#46;value; 
     alert(type + ": " + phone);   
 } 

}
/code

Return to “Issues”