Page 1 of 1

How to populate Contact Service then save to Database collection?

Posted: Mon Jun 23, 2014 10:13 am
by B510

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


How to populate Contact Service then save to Database collection?

Posted: Mon Jun 23, 2014 1:53 pm
by Kateryna Grynko

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