Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:53:50+00:00 2026-06-03T00:53:50+00:00

I am using the SalesForce Beatbox Library ( http://code.google.com/p/salesforce-beatbox/source/browse/trunk/src/beatbox/_beatbox.py ) EXCEPTION 1: When I

  • 0

I am using the SalesForce “Beatbox” Library (http://code.google.com/p/salesforce-beatbox/source/browse/trunk/src/beatbox/_beatbox.py)

EXCEPTION 1: When I just send the leadId, I get the exception “INVALID_CROSS_REFERENCE_KEY: valid leadId is required”

This is saying I’m not using a valid leadId, but I swear it’s a valid leadId because I did a retrieve lead beforehand and took the leadId from SalesForce themselves!

EXCEPTION 2:
When I uncomment the convertedStatus and doNotCreateOpportunity parameters, I get the exception “soapenv:Client fault: Element {urn:partner.soap.sforce.com}doNotCreateOpportunity invalid at this location”

This is saying something is wrong with the way I’m passing the parameters to the SalesForce API. It looks correct to me though.

Any ideas on how to resolve these?

def convertLead(self, leadIds, convertedStatus, doNotCreateOpportunity=False):
     return ConvertLeadRequest(self.__serverUrl, self.sessionId, leadIds, convertedStatus, doNotCreateOpportunity).post(self.__conn)


class ConvertLeadRequest(AuthenticatedRequest):
    """
    Converts a Lead to an Account. See also:
    http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_convertlead.htm
    """
    def __init__(self, serverUrl, sessionId, leadIds, convertedStatus, doNotCreateOpportunity=False):
        AuthenticatedRequest.__init__(self, serverUrl, sessionId, "convertLead")
        self.__convertedStatus = convertedStatus
        self.__leadIds = leadIds;
        self.__doNotCreateOpportunity = doNotCreateOpportunity


    def writeBody(self, s):
        #s.writeStringElement(_partnerNs, "convertedStatus", self.__convertedStatus)
        #s.writeStringElement(_partnerNs, "doNotCreateOpportunity", self.__doNotCreateOpportunity)
        s.writeStringElement(_partnerNs, "leadId", self.__leadIds)

EDIT:

Now, when I make the following request:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:p="urn:partner.soap.sforce.com" xmlns:m="http://soap.sforce.com/2006/04/metadata" xmlns:o="urn:sobject.partner.soap.sforce.com" xmlns:w="http://soap.sforce.com/2006/08/apex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <s:Header>
    <p:CallOptions>
      <p:client>BeatBox/0.9</p:client>
    </p:CallOptions>
    <p:SessionHeader>
          <p:sessionId>REDACTED</p:sessionId>
    </p:SessionHeader>
  </s:Header>
  <s:Body>
    <p:convertLead>
      <p:convertedStatus>Cold Qualified</p:convertedStatus>
      <p:doNotCreateOpportunity>False</p:doNotCreateOpportunity>
      <p:leadId>00QC000000zAbLEMA0</p:leadId>
      <p:overwriteLeadSource>False</p:overwriteLeadSource>
      <p:sendNotificationEmail>False</p:sendNotificationEmail>
    </p:convertLead>
  </s:Body>
</s:Envelope>

I still get the exception “converted status is invalid”

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode>soapenv:Client</faultcode>
      <faultstring>Element {urn:partner.soap.sforce.com}convertedStatus invalid at this location</faultstring>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:53:52+00:00Added an answer on June 3, 2026 at 12:53 am

    The problem is that writeBody is not generating the correct structure. checking the WSDL shows that the convertLead call is expecting to take 0..n of these structures. (Exception #2 is the hint about this)

        <element name="convertLead">
            <complexType>
                <sequence>
                    <element name="leadConverts" type="tns:LeadConvert" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </complexType>
        </element>
    
        <complexType name="LeadConvert">
            <sequence>
                <element name="accountId"              type="tns:ID" nillable="true"/>
                <element name="contactId"              type="tns:ID" nillable="true"/>
                <element name="convertedStatus"        type="xsd:string"/>
                <element name="doNotCreateOpportunity" type="xsd:boolean"/>
                <element name="leadId"                 type="tns:ID"/>
                <element name="opportunityName"        type="xsd:string" nillable="true"/>
                <element name="overwriteLeadSource"    type="xsd:boolean"/>
                <element name="ownerId"                type="tns:ID"     nillable="true"/>
                <element name="sendNotificationEmail"  type="xsd:boolean"/>
            </sequence>
        </complexType>
    

    so your writeBody needs to be something like

    def writeBody(self, s):
        s.startElement(_partnerNs, "leadConverts")
        s.writeElementString(_partnerNs, "convertedStatus", self.__convertedStatus)
        s.writeElementString(_partnerNs, "doNotCreateOpportunity", self.__doNotCreateOpportunity)
        s.writeElementString(_partnerNs, "leadId", self.__leadId)
        ...
        s.endElement()
    

    If you want to do bulk lead convert, then you’ll need to generate multiple instance of this structure for each lead conversion you want to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the bulk upload code described at http://www.salesforce.com/us/developer/docs/api_asynch/ . The only difference
We are implementing SSO for SalesForce using OpenAM. We followed the steps @ http://blogs.oracle.com/rangal/entry/saml2_salesforce_com
I'm testing Salesforce's WebToLead form using this simple example http://wiki.developerforce.com/index.php/Simple_Web2Lead_Implementation . When I changed
I'm using the Developer edition of Salesforce, following this tutorial: http://www.salesforce.com/us/developer/docs/fundamentals/index.htm I've got to
I'm having a problem using Moxy to marshal/unmarshal Salesforce outbound message XMLs. The exception
When using the SOAP API to work with salesforce.com (SFDC) it seems that the
I have been using SOAP to deal with Salesforce.com and have been using the
I am developing a Rails app using OmniAuth, OmniAuth-salesforce and this gem: https://github.com/heroku/databasedotcom I
I'm try to authorize to Salesforce APIs using the Chrome Extension OAuth Library ,
I am using Salesforce api and i want to login automatically(hard code user name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.