I'm trying to update some records via web services. I have some input data which consists of a list of email addresses in a spreadsheet. I need to go through that list 1 by 1 and for each email address return all the matching leads. Once I have my list of leads, which will either be 0, 1 or more than 1, I need to update each record returned by setting 2 checkboxes on the record.
Reading the list of email addresses in from the spreadsheet is simple enough and I have done that. I then call a function that processes the leads. It takes 3 parameters which are the email address, field one and field two. Fields one and two are checkbox values so Y or null.
Here is the function:
public int ProcessLeads(string psEmailAddress, string psFieldOne, string psFieldTwo)
{
string sWhereClause = "lead_personemail = N'" + psEmailAddress + "'";
queryresult oLeads = crm.query(sWhereClause, "lead");
ewarebase[] CRMBase = oLeads.records;
updateresult oCRMLeadUpdateResult;
for (int i = 0; i
{
lead CRMLead = (lead)CRMBase[i];
CRMLead.fieldone = psFieldOne;
CRMLead.fieldtwo = psFieldTwo;
oCRMLeadUpdateResult = crm.updaterecord("lead", CRMBase[i]);
}
return 0;
}
Ignoring the return value at the moment, I am getting a compile error on this line:
oCRMLeadUpdateResult = crm.updaterecord("lead", CRMBase[i]);
The error is:
The best overloaded method match for 'LeadManager.SageCRM.WebService.updaterecord(string, LeadManager.SageCRM.ewarebase[])' has some invalid arguments
Any ideas? All I'm looking to do is update 2 fields based on the values set in the external application.
Thanks.