Note that there are some explanatory texts on larger screens.

plurals
  1. POWith the SalesForce API, what do these two exceptions mean?
    primarykey
    data
    text
    <p>I am using the SalesForce "Beatbox" Library (<a href="http://code.google.com/p/salesforce-beatbox/source/browse/trunk/src/beatbox/_beatbox.py" rel="nofollow">http://code.google.com/p/salesforce-beatbox/source/browse/trunk/src/beatbox/_beatbox.py</a>)</p> <p>EXCEPTION 1: When I just send the leadId, I get the exception "INVALID_CROSS_REFERENCE_KEY: valid leadId is required"</p> <p>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!</p> <p>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"</p> <p>This is saying something is wrong with the way I'm passing the parameters to the SalesForce API. It looks correct to me though.</p> <p>Any ideas on how to resolve these?</p> <pre><code>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) </code></pre> <p>EDIT:</p> <p>Now, when I make the following request:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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"&gt; &lt;s:Header&gt; &lt;p:CallOptions&gt; &lt;p:client&gt;BeatBox/0.9&lt;/p:client&gt; &lt;/p:CallOptions&gt; &lt;p:SessionHeader&gt; &lt;p:sessionId&gt;REDACTED&lt;/p:sessionId&gt; &lt;/p:SessionHeader&gt; &lt;/s:Header&gt; &lt;s:Body&gt; &lt;p:convertLead&gt; &lt;p:convertedStatus&gt;Cold Qualified&lt;/p:convertedStatus&gt; &lt;p:doNotCreateOpportunity&gt;False&lt;/p:doNotCreateOpportunity&gt; &lt;p:leadId&gt;00QC000000zAbLEMA0&lt;/p:leadId&gt; &lt;p:overwriteLeadSource&gt;False&lt;/p:overwriteLeadSource&gt; &lt;p:sendNotificationEmail&gt;False&lt;/p:sendNotificationEmail&gt; &lt;/p:convertLead&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <p>I still get the exception "converted status is invalid"</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soapenv:Body&gt; &lt;soapenv:Fault&gt; &lt;faultcode&gt;soapenv:Client&lt;/faultcode&gt; &lt;faultstring&gt;Element {urn:partner.soap.sforce.com}convertedStatus invalid at this location&lt;/faultstring&gt; &lt;/soapenv:Fault&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload