3 Replies Latest reply: Feb 16, 2012 6:09 AM by user264829 RSS

    Error when querying custom object 5 using contact Id

    user264829
      Hi,

      I have related custom object 5 to contacts in CRM On demand. I am trying to find out the custom object 5 records related to contact based on the contact Id. I'm using the query page function in the wsdl for custom object 5 (web services 2.0) and the SOAP UI tool.
      Here is the SOAP request (I replaced the contact id in the xml below ):

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:crmondemand/ws/ecbs/customobject5/10/2004" xmlns:quer="urn:/crmondemand/xml/CustomObject5/Query">
      <soapenv:Header/>
      <soapenv:Body>
      <ns:CustomObject5QueryPage_Input>

      <quer:ListOfCustomObject5 pagesize="?" startrownum="?" recordcountneeded="?">
      <!--Optional:-->
      <quer:CustomObject5 searchspec="?">

      <!--Optional:-->
      <quer:ContactId sortorder="?" sortsequence="?"><+Id from CRM on demand+></quer:ContactId>


      </quer:CustomObject5>
      </quer:ListOfCustomObject5>

      </ns:CustomObject5QueryPage_Input>
      </soapenv:Body>
      </soapenv:Envelope>


      I get the following response:

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Server</faultcode>
      <faultstring>Field 'Contact Id' in the integration component 'CustomObject5' instance contains invalid query expression: <Contact id that I entered in request>(SBL-EAI-13002)</faultstring>
      <detail>
      <siebelf:siebdetail xmlns:siebelf="http://www.siebel.com/ws/fault">
      <siebelf:logfilename>siebel.log</siebelf:logfilename>
      <siebelf:errorstack>
      <siebelf:error>
      <siebelf:errorcode>(SBL-EAI-13002)</siebelf:errorcode>
      <siebelf:errorsymbol/>
      <siebelf:errormsg>Field 'Contact Id' in the integration component 'CustomObject5' instance contains invalid query expression: <Contact id that I entered in request>(SBL-EAI-13002)</siebelf:errormsg>
      </siebelf:error>
      <siebelf:error>
      <siebelf:errorcode>(SBL-EAI-13006)</siebelf:errorcode>
      <siebelf:errorsymbol/>
      <siebelf:errormsg>Invalid operator: <Contact id that I entered in request>(SBL-EAI-13006)</siebelf:errormsg>
      </siebelf:error>
      </siebelf:errorstack>
      </siebelf:siebdetail>
      </detail>
      </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>


      Can anyone tell me what could be the problem? or what should be the format of the input parameter in the request? I checked in On demand and there should be 1 custom object 5 row returned in the response.
        • 1. Re: Error when querying custom object 5 using contact Id
          mblatchf
          I've had similar error messages when dealing with the OOTB ServiceRequestQuery method into Siebel CRM. To avoid the error it required me to input my operator and quotes in the tag.

          For example.

          <quer:SRNumber sortorder="?" sortsequence="?">='1-87953'</quer:SRNumber>


          Perhaps your issues may also be syntactical?
          • 2. Re: Error when querying custom object 5 using contact Id
            Sablok
            Hi

            Please use the following code for querying

            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:crmondemand/ws/ecbs/customobject5/10/2004" xmlns:quer="urn:/crmondemand/xml/CustomObject5/Query">
            <soapenv:Header/>
            <soapenv:Body>
            <ns:CustomObject5QueryPage_Input>
            <quer:ListOfCustomObject5 pagesize="?" startrownum="?" recordcountneeded="?">
            <!--Optional:-->
            <quer:CustomObject5 searchspec="?">
            <!--Optional:-->
            <quer:ContactId>=\''+Id_from_CRM_on_demand+'\'></quer:ContactId>
            </quer:CustomObject5>
            </quer:ListOfCustomObject5>
            </ns:CustomObject5QueryPage_Input>
            </soapenv:Body>
            </soapenv:Envelope>

            hope that helps !

            Thanks & Regards
            Sablok Kumar
            • 3. Re: Error when querying custom object 5 using contact Id
              user264829
              Hi,

              Thanks a lot . I will try this method too. However, this is how I resolved the problem. I changed my soap request include a search based on contact id:

              <soapenv:Body>
              <cus:CustomObject5QueryPage_Input>

              <quer:ListOfCustomObject5>
              <!--Optional:-->
              <quer:CustomObject5 searchspec="[ContactId]='CRM On Demand Contact Id'">
              <!--You may enter the following 786 items in any order-->
              <quer:Id/>
              <quer:ContactId/>
              <quer:AccountId/>
              <quer:IndexedPick0 />


              </quer:CustomObject5>
              </quer:ListOfCustomObject5>

              </cus:CustomObject5QueryPage_Input>
              </soapenv:Body>

              What I din't realize was that the column names I specified in the quer: tag would be fetched from CRM and returned in the response.

              Regards,