locked
Using Json, JQuery, XMLHttpRequest--Confused RRS feed

  • Question

  • Dear All,

    I am confused totally when to use JQuery, Json, XMlHttpRequest, oData Protocol..I gone through some posts and observed the following

    * Some of them using the jquery, json, jscript webresources on jscript webresource writing ajax method to create a record (account,contact etc.,) What else we ca ndo it here other than creating records?

    * Some of them using only json, jscript webresources and writing on jscript webresource XMLHttpRequest method to create a record. What else we can do it here other than creating records?

    So, What is the best way ? And where we can use oData protocol ?

    Kindly clarify. Thanks in Advance.





    • Edited by crmpnk1 Tuesday, February 7, 2012 4:03 AM
    Monday, February 6, 2012 5:38 PM

Answers

  • First, XmlHttpRequest is the internal browser object that is used to make AJAX requests. It is internally used by jQuery. In both cases, you will be using JSON encoding, as you have observed.

    Currently, the OData endpoint can only be accessed from within the context of the Application. In effect, the endpoint is only accessible when running a JavaScript or Silverlight web resource. This is due to the security mechanisms that are used to authenticate a user. As of now, you can only use the OData endpoint to perform Create, Update, Retrieve, Delete, Associate/Disassociate operations on entity. For all other operations, you need to use the SOAP Endpoint for web resource (http://msdn.microsoft.com/en-us/library/gg594452.aspx), which allows a Web Resource to use the SOAP endpoint.

    Michael

    Thursday, February 9, 2012 11:30 PM
  • I recently added a topic to the SDK to provide a starting point for developers using JavaScript: Use JavaScript with Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online.

    Try starting there. If you get confused, or feel like something is missing or could be added, use the link at the bottom of the page titled "Send comments about this topic to Microsoft." That will allow you to send an email that will be routed to me. I will listen to your feedback and try to route you to the correct answer in the documentation if I can. No guarantees, but I usually respond the same day.

    Your feedback helps me continually improve the documentation.


    Jim Daly Technical Writer Microsoft Dynamics CRM

    • Marked as answer by crmpnk1 Friday, February 10, 2012 2:00 PM
    Friday, February 10, 2012 1:22 AM
    Answerer

All replies

  • First, XmlHttpRequest is the internal browser object that is used to make AJAX requests. It is internally used by jQuery. In both cases, you will be using JSON encoding, as you have observed.

    Currently, the OData endpoint can only be accessed from within the context of the Application. In effect, the endpoint is only accessible when running a JavaScript or Silverlight web resource. This is due to the security mechanisms that are used to authenticate a user. As of now, you can only use the OData endpoint to perform Create, Update, Retrieve, Delete, Associate/Disassociate operations on entity. For all other operations, you need to use the SOAP Endpoint for web resource (http://msdn.microsoft.com/en-us/library/gg594452.aspx), which allows a Web Resource to use the SOAP endpoint.

    Michael

    Thursday, February 9, 2012 11:30 PM
  • I recently added a topic to the SDK to provide a starting point for developers using JavaScript: Use JavaScript with Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online.

    Try starting there. If you get confused, or feel like something is missing or could be added, use the link at the bottom of the page titled "Send comments about this topic to Microsoft." That will allow you to send an email that will be routed to me. I will listen to your feedback and try to route you to the correct answer in the documentation if I can. No guarantees, but I usually respond the same day.

    Your feedback helps me continually improve the documentation.


    Jim Daly Technical Writer Microsoft Dynamics CRM

    • Marked as answer by crmpnk1 Friday, February 10, 2012 2:00 PM
    Friday, February 10, 2012 1:22 AM
    Answerer
  • Hi Michel,

    Thanks for clarifying. So I understood from you that CRM REST Endpoint service we can't use when we are building web applications. But we can use REST endpoints within the context of the CRM Application using web resources.  Correct me if i was wrong.

    Thanks again,

    Friday, February 10, 2012 6:54 AM