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
ddatbig2ddatbig2 

No error message while updating opportunity line item

I am using the following SOAP XML to update opportunity line item. The update fails with no error mesage.

<?xml version = '1.0' encoding = 'UTF-8'?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><SessionHeader xmlns="urn:partner.soap.sforce.com"><sessionId>ORCr7XQHcJwK6bHCH0k80my5jLWqdRr1V6n5_xFkZEz5cwCdYQUqpIc.fw.Vk1LE3UK60WyEfl7sCjgJ05u9nPbtzKggVlhL</sessionId></SessionHeader></soap:Header><soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><create xmlns="urn:partner.soap.sforce.com"/><update xmlns="urn:partner.soap.sforce.com"><sObjects><type xmlns="urn:sobject.partner.soap.sforce.com">OpportunityLineItem</type><Id xmlns="urn:sobject.partner.soap.sforce.com">00k30000001JRBkAAO</Id><OpportunityId xmlns="urn:sobject.partner.soap.sforce.com">00630000001UQElAAO</OpportunityId><Quantity xmlns="">1</Quantity><TotalPrice xmlns="">22.22</TotalPrice><ProductId xmlns="">00j30000000gsJwAAI</ProductId></sObjects><sObjects><type xmlns="urn:sobject.partner.soap.sforce.com">OpportunityLineItem</type><Id xmlns="urn:sobject.partner.soap.sforce.com">00k30000001JRBlAAO</Id><OpportunityId xmlns="urn:sobject.partner.soap.sforce.com">00630000001UQElAAO</OpportunityId><Quantity xmlns="">1</Quantity><TotalPrice xmlns="">22.22</TotalPrice><ProductId xmlns="">00j30000000gsJwAAI</ProductId></sObjects></update></soap:Body></soap:Envelope>

Here is the response XML.

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body>  <createResponse xmlns="urn:partner.soap.sforce.com"/> </soapenv:Body></soapenv:Envelope>
ddatbig2ddatbig2



ORCr7XQHcJwK6bHCH0k80my5jLWqdRr1V6n5_xFkZEz5cwCdYQUqpIc.fw.Vk1LE3UK60WyEfl7sCjgJ05u9nPbtzKggVlhL




OpportunityLineItem00k30000001JRBkAAO00630000001UQElAAO122.2200j30000000gsJwAAI
OpportunityLineItem00k30000001JRBlAAO00630000001UQElAAO122.2200j30000000gsJwAAI



Response

 
    
 

DevAngelDevAngel

Hi ddatbig2,

First, I think you have an error in the xml.  From what I can tell, you have a create AND an update in the same body.

<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
 <create xmlns="urn:partner.soap.sforce.com"/>
 <update xmlns="urn:partner.soap.sforce.com">
  <sObjects>
   <type>OpportunityLineItem</type>
   <Id>00k30000001JRBkAAO</Id>
   <OpportunityId>00630000001UQElAAO</OpportunityId>
   <Quantity xmlns="">1</Quantity>
   <TotalPrice xmlns="">22.22</TotalPrice>
   <ProductId xmlns="">00j30000000gsJwAAI</ProductId>
  </sObjects>
  <sObjects>
   <type xmlns="urn:sobject.partner.soap.sforce.com">OpportunityLineItem</type>
   <Id xmlns="urn:sobject.partner.soap.sforce.com">00k30000001JRBlAAO</Id>
   <OpportunityId>00630000001UQElAAO</OpportunityId>
   <Quantity xmlns="">1</Quantity>
   <TotalPrice xmlns="">22.22</TotalPrice>
   <ProductId xmlns="">00j30000000gsJwAAI</ProductId>
  </sObjects>
 </update>
</soap:Body>

 

Second, according to the describe call that I get as as Admin user with full rights, the OpportunityId and ProductId are not updateable.  Even if you are re-using the original ids for these fields, you cannot include them in an update call.

Try fixing those two things and see how it goes.

Cheers