function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
L0t3kL0t3k 

INVALID_FIELD


I'm getting the following...

Code:
SOAP Exception: INVALID_FIELD: No such column 'Name' on entity 'user'.
 at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse
(SoapClientMessage message, WebResponse response, Stream responseStream,
 Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol
.Invoke(String methodName, Object[] parameters) at ApexEnterprise.SforceService
.update(sObject[] sObjects) in c:\WINDOWS\Microsoft.NET\Framework\
v2.0.50727\Temporary ASP.NET Files\root\8ad21003\1a001cc1\
App_WebReferences.bxqdj_uh.0.cs:line 603 at SF_DAL.SaveLead(Object CurrentLead)
 in C:\Inetpub\TESTSITE\App_Code\SF_DAL.vb:line 78

Whenever I  call this function with a Lead object as an arguement.


 Code:
 Public Shared Function SaveLead(ByVal CurrentLead As Object) As Boolean
        Dim SFContact As ApexEnterprise.Lead = CType(CurrentLead, ApexEnterprise.Lead)
        'HttpContext.Current.Response.Write(SFContact.FirstName)
        Dim strUsername As String = ConfigurationSettings.AppSettings("SFUsername")
        Dim strPassword As String = ConfigurationSettings.AppSettings("SFPassword")
        SFLogin(strUsername, strPassword)
        Try
            Dim myLeads(1) As sObject
            myLeads(0) = SFContact
            Dim saveResult() As SaveResult = Nothing
            SaveResult = myBinding.update(myLeads)
        Catch e As System.Web.Services.Protocols.SoapException
            HttpContext.Current.Response.Write("SOAP Exception: " & e.Message & e.StackTrace)
            Return False
        Catch ex As Exception
            HttpContext.Current.Response.Write("Exception: " & ex.Message & ex.StackTrace)
            Return False
        End Try
        Return True
    End Function
You can see there I've been checking that the Lead object passes to the function properly... and everything seems fine until the update method pukes. 

Any ideas?


SuperfellSuperfell
can you post a capture of your request XML.
L0t3kL0t3k
Oddly, I went back to a few examples I saw around and noticed that folks were creating new object and only populating the fields they want to update... so I did the following:

Code:
   Public Shared Function SaveLead(ByVal CurrentLead As Object) As Boolean
        Dim SFContact As ApexEnterprise.Lead = CType(CurrentLead, ApexEnterprise.Lead)
        'HttpContext.Current.Response.Write(SFContact.FirstName)
        Dim strUsername As String = ConfigurationSettings.AppSettings("SFUsername")
        Dim strPassword As String = ConfigurationSettings.AppSettings("SFPassword")
        SFLogin(strUsername, strPassword)

Dim SFContact1 As New ApexEnterprise.Lead SFContact1.Id = SFContact.Id SFContact1.FirstName = SFContact.FirstName SFContact1.LastName = SFContact.LastName SFContact1.Street = SFContact.Street SFContact1.City = SFContact.City SFContact1.State = SFContact.State SFContact1.PostalCode = SFContact.PostalCode SFContact1.Phone = SFContact.Phone SFContact1.Email = SFContact.Email

Try Dim myLeads(1) As sObject myLeads(0) = SFContact1 Dim saveResult() As SaveResult = Nothing SaveResult = myBinding.update(myLeads) Catch e As System.Web.Services.Protocols.SoapException HttpContext.Current.Response.Write("SOAP Exception: " & e.Message & e.StackTrace) Return False Catch ex As Exception HttpContext.Current.Response.Write("Exception: " & ex.Message & ex.StackTrace) Return False End Try Return True End Function

 And oddly, that works.  Lord knows why... but I'll take it. 

Just have to go back and clean these test functions up now. :)