+ Start a Discussion

Error when creating lead using classic asp

Can someone please help? I'm trying to create a lead in SF using classic asp with theoffice toolking but I keep getting this error "One of the records in the batch call resulted in an error. Examine the records to determine which one(s) failed.".
Dim SforceApi
Dim sObject(0)
Set SforceApi = server.CreateObject("SForceOfficeToolkit3.SForceSession3.1")
if SforceApi.Login("uid","pwd") then
    Set sObject(0) = SforceApi.CreateObject("Lead")
    sObject(0).Item("FirstName").value = "Test"
    sObject(0).Item("LastName").value = "Testing"
     if SforceApi.Create(sObject,false) then
         Response.Write "Correct insert "
          Response.Write "Error on insert"
     end if
     response.Write "login failed"
end if
Set SforceApi = nothing
Set sObject(0) = nothing

I figured it out. I wasn't submiting a company name with the lead which is a required field in salesforce when creating a lead. Hope this helps.