locked
SOAP query RRS feed

  • Question

  • Hi as i am new to writing CRM Query I've got a Fetch XML query but I need to have similar query in SOAP Format which I can use to call from JS within CRM,

    <fetch mapping="logical">
      <entity name="queue">
        <attribute name="name" />
        <filter>
          <condition attribute="name" operator="eq" value="myqueue" />
        </filter>
      </entity>
    </fetch>


    What would be the correct SOAP query

    KV
    Thursday, November 5, 2009 10:29 AM

Answers

  • AKV Dev,

    In my blog article about looking up a lookup , I use a fetchxml request from javascript. I would suggest starting with it.

    The xml (Soap) portion of the soap request would be something like...

    var xml = "" +
      "<?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'>" +
      GenerateAuthenticationHeader() +
      "<soap:Body>" +
      "<Fetch xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
      "<fetchXml>" +
      " &lt;fetch mapping='logical'&gt;" +
      " &lt;entity name='queue'&gt;" +
      " &lt;attribute name='name' /&gt;" +
      " &lt;filter&gt;" +
      " &lt;condition attribute='name' operator='eq' value='myqueue' /&gt;" +
      " &lt;/filter&gt;" +
      " &lt;/entity&gt;" +
      " &lt;/fetch&gt;" +
      "</fetchXml>" +
      "</Fetch>" +
      "</soap:Body>" +
      "</soap:Envelope>";

    Hope that helps. If you need more assistance, please let us know.

    --MSCRM Blogger

    Thursday, November 5, 2009 11:26 AM

All replies

  • Hi,

    You could use this tool to call CrmService from JS within CRM.

    You could put your same condition over there in that tool and and then analyze the final soap request generated by it.

    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    Thursday, November 5, 2009 11:26 AM
  • AKV Dev,

    In my blog article about looking up a lookup , I use a fetchxml request from javascript. I would suggest starting with it.

    The xml (Soap) portion of the soap request would be something like...

    var xml = "" +
      "<?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'>" +
      GenerateAuthenticationHeader() +
      "<soap:Body>" +
      "<Fetch xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
      "<fetchXml>" +
      " &lt;fetch mapping='logical'&gt;" +
      " &lt;entity name='queue'&gt;" +
      " &lt;attribute name='name' /&gt;" +
      " &lt;filter&gt;" +
      " &lt;condition attribute='name' operator='eq' value='myqueue' /&gt;" +
      " &lt;/filter&gt;" +
      " &lt;/entity&gt;" +
      " &lt;/fetch&gt;" +
      "</fetchXml>" +
      "</Fetch>" +
      "</soap:Body>" +
      "</soap:Envelope>";

    Hope that helps. If you need more assistance, please let us know.

    --MSCRM Blogger

    Thursday, November 5, 2009 11:26 AM