• rovaart
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello, when I call the Upsert method I get the following error: INVALID_FIELD: Field name provided, LNG_ID__c is not readable for Account The Field LNG_ID__c is a custom numeric field which is set as an external ID field. I found on this board when I want to use numeric fields I als should set the specified value as true, but that didn't solve the problem. The following VB.NET code I use: Dim myConnection As SqlConnection Dim myCommand As SqlCommand Dim dr As SqlDataReader Dim strName As String Dim SFDCClient As New SFDCClient myConnection = New SqlConnection() myConnection.ConnectionString = GetConString() myConnection.Open() myCommand = New SqlCommand("Select * from relations", myConnection) dr = myCommand.ExecuteReader() Dim accounts As sforce.Account() = New sforce.Account(0) {} dr.Read() accounts(0) = New sforce.Account accounts(0).Name = dr("strcompany").ToString.Trim accounts(0).LNG_ID__c = CDbl(dr("lngID")) accounts(0).LNG_ID__cSpecified = True SFDCClient.Login() Dim result() As sforce.UpsertResult result = SFDCClient.sForceService.upsert("LNG_ID__c", accounts) Could it be a problem that mine field in Salesforce is double and the field in our database is an integer? So when I convert it to double it is like 1.0? Hope someone can help.
Hi all,
 
I am trying to implment the "convertLead" function provided in the Apex manual.
 
I am getting the following error always :-
 
"The name 'binding' does not exist in the current context".
 
Can anyone help please? also can anyone tell me if there is any other way to perform batch lead conversion?
 
 
This is the function:-
 

static bool convertLead(string leadId, string contactId,

string accountId, bool overWriteLeadSource,

bool doNotCreateOpportunity, string opportunityName,

string convertedStatus, bool sendEmailToOwner)

{

SforceService.LeadConvert leadConvert = new SforceService.LeadConvert();

leadConvert.leadId = leadId;

leadConvert.contactId = contactId;

leadConvert.accountId = accountId;

leadConvert.overwriteLeadSource = overWriteLeadSource;

leadConvert.doNotCreateOpportunity = doNotCreateOpportunity;

leadConvert.opportunityName = opportunityName;

leadConvert.convertedStatus = convertedStatus;

leadConvert.sendNotificationEmail = sendEmailToOwner;

SforceService.LeadConvertResult[] lcr = null;

try

{

lcr = binding.convertLead(new SforceService.LeadConvert[] { leadConvert });

for (int i = 0; i < lcr.Length; i++)

if (lcr[i].success)

{

Console.WriteLine("Conversion succeeded.\n");

SforceService.LeadConvertResult result = lcr[i];

Console.WriteLine("The new contact id is: " + result.contactId);

}

else

{

Console.WriteLine("The conversion failed because: " + lcr[i].errors[0].message);

}

}

catch (Exception e)

{

Console.WriteLine("Unexpected error encountered:\n\n" + e.Message);

return false;

}

return true;

}