I have a Cloud instance of Sage. Have allowed Webservice API access.
I'm attempting to add a Lead via The Webservice API. I've added the Service Reference in VS and can access the various methods of the Webservice, however, when I create a Lead, it doesn't show up in the Leads list. The Leads show a count of how many Leads have been created but only those I created in the CRM show up in the list.
I ran a service.queryrecord(header, "*", "", "lead", "leadid"); to get the list of all Leads and all of the ones I created programatically are returned. I compared the fields of the one I manually created with the ones I created via the Webservice and made sure the field data matched. I assume that the assigneduserid field and the opened field need to be set. When I programmatically set these then call the add() method of the service those property values I set don't get inserted into their fields.
ewarebase CRMBase = new ewarebase; var newLead = new lead(); newLead.personfirstname = "John"; newLead.personlastname = "Doe"; newLead.companyname = "Company Name"; newLead.personemail = "firstname.lastname@example.org"; newLead.status = "In Progress"; newLead.description = "A Lead from The website."; newLead.updatedby = 30; newLead.createdby = 30; newLead.assigneduserid = 30; newLead.stage = "New Lead"; newLead.source = "Web"; newLead.priority = "Normal"; newLead.opened = DateTime.Now; newLead.channelid = 7; newLead.decisiontimeframe = "unknown"; newLead.companymatch = "Y";
CRMBase = newLead; addresult aResult = service.add(header, "lead", CRMBase);
30 is the id of the user I want the Lead assigned to. and the DateTime.Now doesn't get submitted either.
opened and assigneduserid are always empty when I query the new Lead.
Anyone know how to add a Lead via the Webservice and have it display in the Leads?
© The Sage Group plc 2019All Rights Reserved