B510
Posts: 0
Joined: Wed Jun 04, 2014 2:17 pm

How to populate Contact Service then save to Database collection?

Dear All

How to populate Contact Service then save to Database collection?
I am trying to run codes below in Success event of Contact Service but no luck :(

var phoneNumbers = data.phoneNumbers;
var name = data.name;
var cname = '';
var cphoneno = '';
//save each contact separately

$(phoneNumbers).each(function(){
cname = name.formatted;
cphoneno = phoneNumbers.value;
restservice1.execute({data:{cname:cname, cphoneno:cphoneno }});
});

msgBox('Im done');

please helpp

thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to populate Contact Service then save to Database collection?

Hi Winanjaya,

Please pass all the parameters in quotes. Replace:prerestservice1.execute({data:{cname:cname, cphoneno:cphoneno }});/preWith:prerestservice1.execute({"data":{"cname":cname, "cphoneno":cphoneno }});/pre

Return to “Issues”