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
prudhviprudhvi 

Problem with attachments query?

Hi Dave,

I am  using following soap message to pull all attachments related to an opportunity.

I am using filter query soap   call to check parentID=<givenopportunityid>.

My opporunity has 3 attachement with it.  My SOAP query request is working fine but some times its giving me  duplicate rows. I mean  I am getting 6 attachements. (for each attachment I am having two value map elements in SOAP response).

Please look at this and let me know why Iam getting this problem.

Thanks and regards,

Prudhvi.

 

 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="salesforce" xmlns:types="salesforce/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
    <tns:headerStruct id="id1">
      <session_id xsi:type="xsd:string">Q4GMyff4ow93EaHLeIwk0.Vt13WweT4OF4KAXdNRsla4pzJSjZzy4uWmqTkyV1FysKU0H19TqOU_mi4p5nFsY.btzKggVlhL</session_id>
      <version xsi:type="xsd:string">2.0</version>
    </tns:headerStruct>
  </soap:Header>
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <q1:query xmlns:q1="sfconnector:SalesforceConnector">
      <version xsi:type="xsd:string">2.0</version>
      <session_id xsi:type="xsd:string">Q4GMyff4ow93EaHLeIwk0.Vt13WweT4OF4KAXdNRsla4pzJSjZzy4uWmqTkyV1FysKU0H19TqOU_mi4p5nFsY.btzKggVlhL</session_id>
      <scope xsi:type="xsd:string">filter</scope>
      <type xsi:type="xsd:string">attachment</type>
      <select href="#id1"/>
      <filter href="#id2"/>
    </q1:query>
    <soapenc:Array id="id3" soapenc:arrayType="tns:mapEntry[3]">
      <Item href="#id4"/>
      <Item href="#id5"/>
      <Item href="#id6"/>
    </soapenc:Array>
    <soapenc:Array id="id2" soapenc:arrayType="xsd:anyType[1]">
      <Item href="#id3"/>
    </soapenc:Array>
    <soapenc:Array id="id1" soapenc:arrayType="xsd:string[4]">
      <Item>id</Item>
      <Item>parentID</Item>
      <Item>name</Item>
      <Item>bodyLength</Item>
      <Item>ownerID</Item>
      <Item>createdDate</Item>
      <Item>createdByID</Item>
      <Item>lastModifiedDate</Item>
      <Item>lastModifiedByID</Item>
      <Item>systemModstamp</Item>
    </soapenc:Array>
    <tns:mapEntry id="id6" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">operator</key>
      <value xsi:type="xsd:string">equals</value>
    </tns:mapEntry>
    <tns:mapEntry id="id4" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">field</key>
      <value xsi:type="xsd:string">parentID</value>
    </tns:mapEntry>
    <tns:mapEntry id="id5" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">value</key>
      <value xsi:type="xsd:string">00600000006qJqB</value>
    </tns:mapEntry>
  </soap:Body>
</soap:Envelope>

prudhviprudhvi

Hi Dave,

I am  using following soap message to pull all attachments related to an opportunity.

I am using filter query soap   call to check parentID=<givenopportunityid>.

My opporunity has 3 attachement with it.  My SOAP query request is working fine but some times its giving me  duplicate rows. I mean  I am getting 6 attachements. (for each attachment I am having two value map elements in SOAP response).

Please look at this and let me know why Iam getting this problem.

Thanks and regards,

Prudhvi.

 

 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="salesforce" xmlns:types="salesforce/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
    <tns:headerStruct id="id1">
      <session_id xsi:type="xsd:string">Q4GMyff4ow93EaHLeIwk0.Vt13WweT4OF4KAXdNRsla4pzJSjZzy4uWmqTkyV1FysKU0H19TqOU_mi4p5nFsY.btzKggVlhL</session_id>
      <version xsi:type="xsd:string">2.0</version>
    </tns:headerStruct>
  </soap:Header>
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <q1:query xmlns:q1="sfconnector:SalesforceConnector">
      <version xsi:type="xsd:string">2.0</version>
      <session_id xsi:type="xsd:string">Q4GMyff4ow93EaHLeIwk0.Vt13WweT4OF4KAXdNRsla4pzJSjZzy4uWmqTkyV1FysKU0H19TqOU_mi4p5nFsY.btzKggVlhL</session_id>
      <scope xsi:type="xsd:string">filter</scope>
      <type xsi:type="xsd:string">attachment</type>
      <select href="#id1"/>
      <filter href="#id2"/>
    </q1:query>
    <soapenc:Array id="id3" soapenc:arrayType="tns:mapEntry[3]">
      <Item href="#id4"/>
      <Item href="#id5"/>
      <Item href="#id6"/>
    </soapenc:Array>
    <soapenc:Array id="id2" soapenc:arrayType="xsd:anyType[1]">
      <Item href="#id3"/>
    </soapenc:Array>
    <soapenc:Array id="id1" soapenc:arrayType="xsd:string[4]">
      <Item>id</Item>
      <Item>parentID</Item>
      <Item>name</Item>
      <Item>bodyLength</Item>
      <Item>ownerID</Item>
      <Item>createdDate</Item>
      <Item>createdByID</Item>
      <Item>lastModifiedDate</Item>
      <Item>lastModifiedByID</Item>
      <Item>systemModstamp</Item>
    </soapenc:Array>
    <tns:mapEntry id="id6" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">operator</key>
      <value xsi:type="xsd:string">equals</value>
    </tns:mapEntry>
    <tns:mapEntry id="id4" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">field</key>
      <value xsi:type="xsd:string">parentID</value>
    </tns:mapEntry>
    <tns:mapEntry id="id5" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">value</key>
      <value xsi:type="xsd:string">00600000006qJqB</value>
    </tns:mapEntry>
  </soap:Body>
</soap:Envelope>