<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx</link><description>Since I wrote the post about calling "any" web service from CRM forms (BTW, that is my most viewed post to date!), folks have written to me and asked "what the heck, what about calling “CRM” web services, hello"? Calling CRM web services from JScript</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Mitch Milam&amp;#8217;s Microsoft Discussions  &amp;raquo; Blog Archive   &amp;raquo; The CRM Team Rocks! More sample code</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#730253</link><pubDate>Tue, 29 Aug 2006 20:02:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:730253</guid><dc:creator>Mitch Milam’s Microsoft Discussions  » Blog Archive   » The CRM Team Rocks! More sample code</dc:creator><description>PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.infinite-x.net/2006/08/29/the-crm-team-rocks-more-sample-code/"&gt;http://blogs.infinite-x.net/2006/08/29/the-crm-team-rocks-more-sample-code/&lt;/a&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#737941</link><pubDate>Sun, 03 Sep 2006 15:06:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:737941</guid><dc:creator>Josh Behl</dc:creator><description>So, will this work if I am on the laptop client and off line? &amp;nbsp;Can I still tap into the CRM Web Service or do I need to query my offline data directly?</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#742411</link><pubDate>Wed, 06 Sep 2006 11:30:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:742411</guid><dc:creator>ArashSichanie</dc:creator><description>Josh &lt;BR&gt;This will only work against the CRM server.&amp;nbsp;&amp;nbsp;There is no offline support in V3.0 (My bad in previous comment).</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#754167</link><pubDate>Thu, 14 Sep 2006 18:42:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:754167</guid><dc:creator>Darin</dc:creator><description>I am trying to do the same thing with the GrantAccess method. &amp;nbsp;Not having luck with the SOAP part. &amp;nbsp;Any advice on how I can find out how to do this?&lt;br&gt;&lt;br&gt;I am not sure how to include the PrincipalAccess information (i.e. AccessMask, prinicpal) and Target into the SOAP envelop.&lt;br&gt;&lt;br&gt;Any suggestions?</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#755960</link><pubDate>Fri, 15 Sep 2006 16:54:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:755960</guid><dc:creator>Kyle</dc:creator><description>We've copied this code (from the line that reads &amp;quot;var server url=...&amp;quot; to the closing bracket for the for loop) for testing purposes into an OnLoad event into a entity. We modifed the address1_stateorprovince field of an account to &amp;quot;WA&amp;quot; so it would return that account, but it does not. The responseXML is empty, so then the code obviously fails when trying to access a null array element (BEs[1]).
&lt;br&gt;
&lt;br&gt;Any idea what might be causing this?</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#760172</link><pubDate>Mon, 18 Sep 2006 07:12:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:760172</guid><dc:creator>ArashSichanie</dc:creator><description>Hi Darin&lt;br&gt;If you make a GrantAccess (or any other request) call while tracing is on, you can see the SOAP message in the trace file. &amp;nbsp;For GrantAccess, you will see this SOAP message:&lt;br&gt;&lt;br&gt;SOAP Request:&lt;br&gt;URL:CrmService.asmx&lt;br&gt;HttpHeader:SOAPAction: &lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/crm/2006/WebServices/Execute"&gt;http://schemas.microsoft.com/crm/2006/WebServices/Execute&lt;/a&gt;&lt;br&gt;&lt;br&gt;SOAP Xml:&lt;br&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br&gt;&amp;lt;soap:Envelope xmlns:soap=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://schemas.xmlsoap.org/soap/envelope/&amp;quot;"&gt;http://schemas.xmlsoap.org/soap/envelope/&amp;quot;&lt;/a&gt; xmlns:xsi=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://www.w3.org/2001/XMLSchema-instance&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/a&gt; xmlns:xsd=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://www.w3.org/2001/XMLSchema&amp;quot;&amp;gt;"&gt;http://www.w3.org/2001/XMLSchema&amp;quot;&amp;gt;&lt;/a&gt;&lt;br&gt;&amp;lt;soap:Body&amp;gt;&lt;br&gt;&amp;lt;Request xsi:type=&amp;quot;GrantAccessRequest&amp;quot; xmlns=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/crm/2006/WebServices&amp;quot;&amp;gt;"&gt;http://schemas.microsoft.com/crm/2006/WebServices&amp;quot;&amp;gt;&lt;/a&gt;&lt;br&gt;&amp;lt;Target xsi:type=&amp;quot;TargetOwnedAccount&amp;quot;&amp;gt;&lt;br&gt;&amp;lt;EntityId&amp;gt;948c2aa0-984c-4439-a92a-c015b32dcba9&amp;lt;/EntityId&amp;gt;&lt;br&gt;&amp;lt;/Target&amp;gt;&lt;br&gt;&amp;lt;PrincipalAccess&amp;gt;&lt;br&gt;&amp;lt;Principal xmlns=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/crm/2006/CoreTypes&amp;quot;&amp;gt;"&gt;http://schemas.microsoft.com/crm/2006/CoreTypes&amp;quot;&amp;gt;&lt;/a&gt;&lt;br&gt;&amp;lt;PrincipalId&amp;gt;6ce4df0c-0948-da11-a7a7-00065ba4662d&amp;lt;/PrincipalId&amp;gt;&lt;br&gt;&amp;lt;Type&amp;gt;User&amp;lt;/Type&amp;gt;&lt;br&gt;&amp;lt;/Principal&amp;gt;&lt;br&gt;&amp;lt;AccessMask xmlns=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/crm/2006/CoreTypes&amp;quot;&amp;gt;"&gt;http://schemas.microsoft.com/crm/2006/CoreTypes&amp;quot;&amp;gt;&lt;/a&gt;WriteAccess&amp;lt;/AccessMask&amp;gt;&lt;br&gt;&amp;lt;/PrincipalAccess&amp;gt;&lt;br&gt;&amp;lt;/Request&amp;gt;&lt;br&gt;&amp;lt;/soap:Body&amp;gt;&lt;br&gt;&amp;lt;/soap:Envelope&amp;gt;&lt;br&gt;&lt;br&gt;Now all you need to do is to create a string with this soap message like what i did with QueryByAttribute and send it to the server.&lt;br&gt;&lt;br&gt;Good luck</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#760182</link><pubDate>Mon, 18 Sep 2006 07:20:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:760182</guid><dc:creator>ArashSichanie</dc:creator><description>Hi Kyle&lt;br&gt;There might be a number of possible reasons and debugging tips 1) Make sure that you have included your server name where it says so in the code 2) Make sure activeX is enabled in your browser(go to IE -&amp;gt; Settings -&amp;gt; check the box with prompt for Activex) 3) if you are sure the browser is calling the server, make sure if the server is receiving the web service call by turning on the tracing and viewing the log to ensure the SOAP call is recieved.</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#794364</link><pubDate>Thu, 05 Oct 2006 21:50:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:794364</guid><dc:creator>Nick Doelman</dc:creator><description>&lt;P&gt;Thanks for this awesome code. &amp;nbsp;I was able to modify it to create a picklist of contact names for the related account on an opportunity form and thus able to have multiple contacts, ie-client contact, client executive contact, etc on the opportunity form and views.&lt;/P&gt;
&lt;P&gt;I was also able to use this method to have multiple users on a form as well (main owner, technical contact, project leader, etc)&lt;/P&gt;
&lt;P&gt;My question is this, where do you find the XML schema structure to structure the query request in XML format? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand the "querybyattribute" structure, but what if I want to do something similar using "querybyexpression"? &amp;nbsp;I can do this in a ASPX page using C# but this would run faster if I could do this in an onchange like above. &amp;nbsp;I can't seem to locate this in the SDK, or am I missing something *really* obvious? &amp;nbsp;I am just unclear of where to put/embed things like &amp;lt;linkedentity&amp;gt; and &amp;lt;filterexpression&amp;gt;, etc&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Nick&lt;/P&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#807358</link><pubDate>Mon, 09 Oct 2006 07:53:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:807358</guid><dc:creator>ArashSichanie</dc:creator><description>&lt;p&gt;Nick&lt;/p&gt;
&lt;p&gt;Great to hear you are using this. &amp;nbsp;Two ways to find out about the schema and build your XML 1) use the CrmService.asmx web service WSDL, &amp;nbsp;the WSDL includes the schema for QueryExpression and all of the rest of CRM types 2) Enable tracing (follow the link in the my post), make a web service call using C# and view the tracing log. &amp;nbsp;The tracing log will have the SOAP XML that you need to use in your form JScript.&lt;/p&gt;
</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#816933</link><pubDate>Wed, 11 Oct 2006 17:08:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:816933</guid><dc:creator>Kyle</dc:creator><description>&lt;P&gt;We've tried this code in the CRM Web Browser client and it works fine. The Outlook client, however, fails when it reaches the "xmlhttp.open()" line. The error we receive is an "Unknown name" error.&lt;/P&gt;
&lt;P&gt;Any ideas what may be causing this?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;- Kyle&lt;/P&gt;</description></item><item><title>Kan du anropa webservices via javascript ?</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#834635</link><pubDate>Tue, 17 Oct 2006 14:43:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:834635</guid><dc:creator>Microsoft Dynamics CRM Norge</dc:creator><description>&lt;p&gt;Webservices Webservices Webservices....alla pratar om dem, alla vill ha det och vi har det :) Visste&lt;/p&gt;
</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#834704</link><pubDate>Tue, 17 Oct 2006 15:11:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:834704</guid><dc:creator>- B@rney</dc:creator><description>&lt;p&gt;Or you can use Microsofts own JavaScript classes (or modified versions of them) like I did here: &lt;a rel="nofollow" target="_new" href="http://www.sharepointdemo.biz/blogs/bjarne/default.aspx?BlogId=101"&gt;http://www.sharepointdemo.biz/blogs/bjarne/default.aspx?BlogId=101&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#835062</link><pubDate>Tue, 17 Oct 2006 18:25:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:835062</guid><dc:creator>Darin</dc:creator><description>&lt;P&gt;Nick,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Another way, one that seemed easier than the trace log, was to use a tool called WebserviceStudio. &amp;nbsp;Just point to your webservice (ie. CrmService.asmx) and press a button to get all the available method in the web service.&lt;/P&gt;
&lt;P&gt;Then you can choose between a QueryExpression or QueryByAttribute, etc. &amp;nbsp;Then just fill in your criteria and press another button. &amp;nbsp;On the Request/Response tab will be your SOAP messages, just how you need them.&lt;/P&gt;
&lt;P&gt;Took me an hour to figure out how to use it correctly to generate the correct SOAP messgae (if you set it up wrong, you get an error).&lt;/P&gt;
&lt;P&gt;Hope this app helps you, too.&lt;/P&gt;
&lt;P&gt;Darin&lt;/P&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#1241717</link><pubDate>Fri, 08 Dec 2006 22:04:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1241717</guid><dc:creator>Ken</dc:creator><description>&lt;p&gt;The first time the web-service is called after opening CRM, I'm being prompted with a Login. &amp;nbsp;Is there any way to eliminate this?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Ken&lt;/p&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#1287983</link><pubDate>Thu, 14 Dec 2006 23:32:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1287983</guid><dc:creator>KyleCRM</dc:creator><description>&lt;p&gt;We've been using this code for quite some time and it works great. However, if we're using the Outlook Laptop Client, and we're trying to access &amp;quot;&lt;a rel="nofollow" target="_new" href="http://localhost:2525/MSCRMServices/2006&amp;quot;"&gt;http://localhost:2525/MSCRMServices/2006&amp;quot;&lt;/a&gt; (the local website), the process fails.&lt;/p&gt;
&lt;p&gt;Is there a way to get this to work?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;- Kyle&lt;/p&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#1317226</link><pubDate>Mon, 18 Dec 2006 17:50:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1317226</guid><dc:creator>Peter Widmer</dc:creator><description>&lt;p&gt;Solution for unknown name&lt;/p&gt;
&lt;p&gt;The problem is, that your webservice is running on a separate website. It &lt;/p&gt;
&lt;p&gt;should be working fine, if you create a new virtual-directory under the Crm &lt;/p&gt;
&lt;p&gt;Website and try it again. (Don't forget to change the link on your formscript &lt;/p&gt;
&lt;p&gt;to the new WS-Url ;-)&lt;/p&gt;
&lt;p&gt;If anybody is good in security topics, why does this happen and is it &lt;/p&gt;
&lt;p&gt;possible to run the webservice on a separated website? &lt;/p&gt;
&lt;p&gt;Hope anybody can save the time I wasted...&lt;/p&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#1336720</link><pubDate>Thu, 21 Dec 2006 05:05:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1336720</guid><dc:creator>ArashSichanie</dc:creator><description>&lt;p&gt;IE prevents calling web services that are in different domain from where the page is loaded from. &amp;nbsp;This is a security feature that prevents cross-site scripting. &amp;nbsp; The Outlook client uses the current machine hence it is on a seperate domain. &amp;nbsp;The suggestion is to &amp;nbsp;have your web service and web site both on the same domain.&lt;/p&gt;
</description></item><item><title>How to reopen a closed appointment and make changes to the file</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#1837371</link><pubDate>Thu, 08 Mar 2007 18:54:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1837371</guid><dc:creator>Microsoft Dynamics CRM Team Blog</dc:creator><description>&lt;p&gt;There are some good reasons why an appointment is read-only after closing it. But sometimes it could&lt;/p&gt;
</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#1915916</link><pubDate>Tue, 20 Mar 2007 04:42:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1915916</guid><dc:creator>...</dc:creator><description>&lt;p&gt;Great site! Good luck to it's owner!&lt;/p&gt;</description></item><item><title>re: Calling “CRM” Web services using JScript</title><link>http://blogs.msdn.com/arash/archive/2006/08/29/729320.aspx#2548350</link><pubDate>Fri, 11 May 2007 18:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2548350</guid><dc:creator>Martyn (Anite Group PLC)</dc:creator><description>&lt;p&gt;Hi I have a script similar to above that uses location.hostname to work out part of the connection for xmlHttpRequest.Open&lt;/p&gt;
&lt;p&gt;For those that use the Outlook Off Line Client it fails to run in all circumstances (both online and off line). &amp;nbsp;Change the location.hostname to the server location and it works in the outlook off line client when you are online and connected to the network, but fails as soon as you are disconnected from the network (kind of obvious) Note: using version 3.053.&lt;/p&gt;
&lt;p&gt;I am wondering if there is something that I can do on the local websever (Cassini I think) that is on the client machine that has CRM Outlook Off Line Client is installed. &amp;nbsp;A couple of posts referred to using local virtual directory (Peter Widmer) but when looking for the cassini exe file on the local machine it was not there.&lt;/p&gt;
&lt;p&gt;Help Please :)&lt;/p&gt;</description></item></channel></rss>