Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Wednesday, January 14, 2015

Dynamics CRM Bookmarklets Collection (CBC)

A few weeks ago i found a nice post from Deepesh Somani where he describes its collection of bookmarklets. This helpers are very nice but unfortunately it was not possible to import them in Internet Explorer, only Chrome worked for me. Based on this experience i created a collection of the most important ones (my point of view) and added additional ones.


Project Page: http://markuskonrad.de/cbc/


Introduction Video:


Cheers

Wednesday, October 23, 2013

CRM 2013 – Official Microsoft statement for jQuery usage

In the latest documentation you can find the document

Using jQuery with Microsoft Dynamics CRM 2013.docx

In this, Microsoft describes the prefered usage of jQuery in the Microsoft Dynamics CRM context.

Usage in HTML Webresources

Microsoft: When creating user interfaces with HTML web resources we highly recommend that you also use jQuery. It provides many benefits in creating pages that support multiple browsers that it is practically a necessity.

So this is fine and i think everyone is doing this right now.

Usage in Entity-Forms

Microsoft: However, when creating form scripts we do not recommend that you use jQuery. To enforce business logic in forms we provide objects in the Xrm.Page and Xrm.Utility namespaces that you use to apply your business logic within the form. We do not support referencing or manipulating the DOM (including styles) for our pages in any way. …

Ok, i have done this in the past and i don’t want to miss a lot of the jquery functions (ajax….) in the future too. So to make sure you don’t run into big issues try the following.

  • Avoid “hard” CSS/DOM Manipulation via jQuery

Microsoft: We reserve the right to restructure or rename DOM elements in our pages at any time without notice. If your code has dependencies on any objects defined in the DOM and these objects are reorganized or renamed your code will break.

  • Assuming you are not the only one who is delivering solutions for your customer, use the following construct to create your specific jQuery-Object ($).
   1: my$ = jQuery.noConflict(true);
   2: my$.trim("     some text with space     ");

Cheers

Wednesday, July 31, 2013

CRM 2013 No longer supported stuff

Following stuff is no longer supported in CRM 2013.
  • CRM 4.0 Custom Workflow Tools
  • CRM 4.0 Client Side Scripting
  • CRM 4.0 Plugins
  • 2007 WebService
  • ISV Folder
  • Solution Down Level Tool
Cheers

Friday, February 8, 2013

Call custom WCF Soap Service from Javascript

In my posts regarding oData, you can find JavaScript calls against WCF DataServices. Here i describe the call against a default WCF SOAP Endpoint.

WCF Service:
  public class Service1 : IService1 {
      public string GetData(int value) {
          return string.Format("You entered: {0}", value);
      }
  }

JavaScript:
function Retrieve(id) {
 jQuery.support.cors = true;
 var soapData = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' + '<s:Body><GetData xmlns="http://tempuri.org/"><value>200</value></GetData></s:Body></s:Envelope>';
 $.ajax({
     type: "POST",
     contentType: "text/xml; charset=utf-8",
     dataType: "xml",
     url: "http://localhost:58282/Service1.svc",
     data: soapData,
     beforeSend: function (xhr) {
       xhr.setRequestHeader("SOAPAction""http://tempuri.org/IService1/GetData");
     },
     success: RetrieveCallbackSuccess,
     error: RetrieveCallbackError
 });
}
function RetrieveCallbackSuccess(response) {     alert("Yey! :) --> " + response.text); }
function RetrieveCallbackError(err) {     alert("Onoz! :( --> " + err.statusText); }

The line "jQuery.support.cors = true" is important for cross domain requests.

Cheers,
Markus