Answered by:
SOAP query

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
KVThursday, 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>" + " <fetch mapping='logical'>" + " <entity name='queue'>" + " <attribute name='name' />" + " <filter>" + " <condition attribute='name' operator='eq' value='myqueue' />" + " </filter>" + " </entity>" + " </fetch>" + "</fetchXml>" + "</Fetch>" + "</soap:Body>" + "</soap:Envelope>";
Hope that helps. If you need more assistance, please let us know.
--MSCRM Blogger
- Proposed as answer by Carlton ColterMicrosoft employee Thursday, November 5, 2009 11:27 AM
- Marked as answer by DavidJennawayMVP, Moderator Monday, December 7, 2009 12:28 PM
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.comThursday, 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>" + " <fetch mapping='logical'>" + " <entity name='queue'>" + " <attribute name='name' />" + " <filter>" + " <condition attribute='name' operator='eq' value='myqueue' />" + " </filter>" + " </entity>" + " </fetch>" + "</fetchXml>" + "</Fetch>" + "</soap:Body>" + "</soap:Envelope>";
Hope that helps. If you need more assistance, please let us know.
--MSCRM Blogger
- Proposed as answer by Carlton ColterMicrosoft employee Thursday, November 5, 2009 11:27 AM
- Marked as answer by DavidJennawayMVP, Moderator Monday, December 7, 2009 12:28 PM
Thursday, November 5, 2009 11:26 AM