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 

help to query the attachements

Hi All,

 I have one requirement to query all the attachement names for a given opportunity.

 I am querying attachements based on parentID( Opportunity ID). its working fine, but taking long time to process the request. Can any one please help me to tune my soap request.

any help would be much appreciated.

My Soap request is like this.

<?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">dgfsafgdsgsgfdsg</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">dgfsafgdsgsgfdsg</session_id>
      <scope xsi:type="xsd:string">filter</scope>
      <type xsi:type="xsd:string">attachment</type>
      <maxRows xsi:type="xsd:int">10</maxRows>
      <select href="#id1"/>
      <filter href="#id2"/>
    </q1:query>
    <soapenc:Array id="id1" soapenc:arrayType="xsd:string[4]">
      <Item>id</Item>
      <Item>name</Item>
      <Item>lastModifiedDate</Item>
    </soapenc:Array>
    <soapenc:Array id="id2" soapenc:arrayType="xsd:anyType[1]">
      <Item href="#id3"/>
    </soapenc:Array>
    <soapenc:Array id="id3" soapenc:arrayType="tns:mapEntry[3]">
      <Item href="#id4"/>
      <Item href="#id5"/>
      <Item href="#id6"/>
    </soapenc:Array>
    <tns:mapEntry id="id5" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">value</key>
      <value xsi:type="xsd:string">00600000006qJqB</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="id6" xsi:type="tns:mapEntry">
      <key xsi:type="xsd:string">operator</key>
      <value xsi:type="xsd:string">equals</value>
    </tns:mapEntry>
  </soap:Body>
</soap:Envelope>