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
PauloPaulo 

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 "
     else
          Response.Write "Error on insert"
     end if
else
     response.Write "login failed"
end if
 
Set SforceApi = nothing
Set sObject(0) = nothing
PauloPaulo

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.

Paulo