745. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2/1/2017 2:57:01 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

745.1 Files compared

# Location File Last Modified
1 C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM\trunk\SDK\SampleCode\JS\RESTEndpoint\RESTJQueryContactEditor\RESTJQueryContactEditor\Scripts RESTJQueryContactEditor.js Tue Dec 20 19:51:48 2016 UTC
2 Wed Feb 1 19:57:01 2017 UTC

745.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 0 0
Inserted 0 0
Removed 1 425

745.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

745.4 Active regular expressions

No regular expressions were active.

745.5 Comparison detail

1          
2   // ======= ========== ========== ========== ========== ========== ========== ==        
3   //  This f ile is par t of the M icrosoft D ynamics CR M SDK code  samples.        
4   //        
5   //  Copyri ght (C) Mi crosoft Co rporation.   All righ ts reserve d.        
6   //        
7   //  This s ource code  is intend ed only as  a supplem ent to Mic rosoft        
8   //  Develo pment Tool s and/or o n-line doc umentation .  See the se other        
9   //  materi als for de tailed inf ormation r egarding M icrosoft c ode sample s.        
10   //        
11   //  THIS C ODE AND IN FORMATION  ARE PROVID ED "AS IS"  WITHOUT W ARRANTY OF  ANY        
12   //  KIND,  EITHER EXP RESSED OR  IMPLIED, I NCLUDING B UT NOT LIM ITED TO TH E        
13   //  IMPLIE D WARRANTI ES OF MERC HANTABILIT Y AND/OR F ITNESS FOR  A        
14   //  PARTIC ULAR PURPO SE.        
15   // ======= ========== ========== ========== ========== ========== ========== ==        
16          
17   /// <refer ence path= "jquery-1. 9.1.js" />        
18          
19   //GetGloba lContext f unction ex ists in Cl ientGlobal Context.js .aspx so t he        
20   //host HTM L page mus t have a r eference t o ClientGl obalContex t.js.aspx.        
21   var contex t = GetGlo balContext ();        
22          
23   //Retrieve  the clien t url        
24   var client Url = cont ext.getCli entUrl();        
25          
26          
27          
28   //The XRM  OData end- point        
29   var ODATA_ ENDPOINT =  "/XRMServ ices/2011/ Organizati onData.svc ";        
30          
31          
32          
33   function c reateRecor d(entityOb ject, odat aSetName,  successCal lback, err orCallback )        
34   {        
35    ///    <s ummary>        
36    ///             Uses  jQuery's  AJAX objec t to call  the Micros oft Dynami cs CRM ODa ta endpoin t to        
37    ///     C reate a ne w record        
38    ///    </ summary>        
39    /// <para m name="en tityObject " type="Ob ject" requ ired="true ">        
40    ///             1: e ntity - a  loose-type  object re presenting  an OData  entity. an y fields        
41    ///                   on this o bject must  be camel- cased and  named exac tly as the        
42    ///                   appear in  entity me tadata        
43    ///    </ param>        
44    /// <para m name="od ataSetName " type="st ring" requ ired="true ">        
45    ///             1: s et -    a  string rep resenting  an OData S et. OData  provides u ri access        
46    ///                   to any CR M entity c ollection.  examples:  AccountSe t, Contact Set,        
47    ///                   Opportuni tySet.         
48    ///    </ param>        
49    /// <para m name="su ccessCallb ack" type= "function"  >        
50    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon s uccess        
51    ///                   of the aj ax invocat ion.        
52    ///    </ param>        
53    /// <para m name="er rorCallbac k" type="f unction" >        
54    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon e rror        
55    ///                   of the aj ax invocat ion.        
56    ///    </ param>        
57          
58          
59    //entityO bject is r equired        
60    if (!enti tyObject)        
61    {        
62     alert("e ntityObjec t is requi red.");        
63     return;        
64    }        
65    //odataSe tName is r equired, i .e. "Accou ntSet"        
66    if (!odat aSetName)        
67    {        
68     alert("o dataSetNam e is requi red.");        
69     return;        
70    }        
71    else        
72    { odataSe tName = en codeURICom ponent(oda taSetName) ; }        
73          
74    //Parse t he entity  object int o JSON        
75    var jsonE ntity = wi ndow.JSON. stringify( entityObje ct);        
76          
77    //Asynchr onous AJAX  function  to Create  a CRM reco rd using O Data        
78    $.ajax({        
79     type: "P OST",        
80     contentT ype: "appl ication/js on; charse t=utf-8",        
81     datatype : "json",        
82     url: cli entUrl + O DATA_ENDPO INT + "/"  + odataSet Name,        
83     data: js onEntity,        
84     beforeSe nd: functi on (XMLHtt pRequest)        
85     {        
86      //Speci fying this  header en sures that  the resul ts will be  returned  as JSON.                       
87      XMLHttp Request.se tRequestHe ader("Acce pt", "appl ication/js on");        
88     },        
89     success:  function  (data, tex tStatus, X mlHttpRequ est)        
90     {        
91      if (suc cessCallba ck)        
92      {        
93       succes sCallback( data.d, te xtStatus,  XmlHttpReq uest);        
94      }        
95     },        
96     error: f unction (X mlHttpRequ est, textS tatus, err orThrown)        
97     {        
98      if (err orCallback )        
99       errorC allback(Xm lHttpReque st, textSt atus, erro rThrown);        
100      else        
101       errorH andler(Xml HttpReques t, textSta tus, error Thrown);        
102     }        
103    });        
104   }        
105          
106   function r etrieveRec ord(id, od ataSetName , successC allback, e rrorCallba ck)        
107   {        
108    ///    <s ummary>        
109    ///             Uses  jQuery's  AJAX objec t to call  the Micros oft Dynami cs CRM ODa ta endpoin t to        
110    ///     r etrieve an  existing  record        
111    ///    </ summary>        
112    /// <para m name="id " type="gu id" requir ed="true">        
113    ///             1: i d -     th e guid (pr imarykey)  of the rec ord to be  retrieved        
114    ///    </ param>        
115    /// <para m name="od ataSetName " type="st ring" requ ired="true ">        
116    ///             1: s et -    a  string rep resenting  an OData S et. OData  provides u ri access        
117    ///                   to any CR M entity c ollection.  examples:  AccountSe t, Contact Set,        
118    ///                   Opportuni tySet.         
119    ///    </ param>        
120    /// <para m name="su ccessCallb ack" type= "function"  >        
121    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon s uccess        
122    ///                   of the aj ax invocat ion.        
123    ///    </ param>        
124    /// <para m name="er rorCallbac k" type="f unction" >        
125    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon e rror        
126    ///                   of the aj ax invocat ion.        
127    ///    </ param>        
128          
129    //id is r equired        
130    if (!id)        
131    {        
132     alert("r ecord id i s required .");        
133     return;        
134    }        
135    else        
136    {        
137     id = enc odeURIComp onent(id);        
138    }        
139    //odataSe tName is r equired, i .e. "Accou ntSet"        
140    if (!odat aSetName)        
141    {        
142     alert("o dataSetNam e is requi red.");        
143     return;        
144    }        
145    else        
146    { odataSe tName = en codeURICom ponent(oda taSetName) ; }        
147          
148    //Asynchr onous AJAX  function  to Retriev e a CRM re cord using  OData        
149    $.ajax({        
150     type: "G ET",        
151     contentT ype: "appl ication/js on; charse t=utf-8",        
152     datatype : "json",        
153     url: cli entUrl + O DATA_ENDPO INT + "/"  + odataSet Name + "(g uid'" + id  + "')",        
154     beforeSe nd: functi on (XMLHtt pRequest)        
155     {        
156      //Speci fying this  header en sures that  the resul ts will be  returned  as JSON.                       
157      XMLHttp Request.se tRequestHe ader("Acce pt", "appl ication/js on");        
158     },        
159     success:  function  (data, tex tStatus, X mlHttpRequ est)        
160     {        
161      if (suc cessCallba ck)        
162      {        
163       succes sCallback( data.d, te xtStatus,  XmlHttpReq uest);        
164      }        
165     },        
166     error: f unction (X mlHttpRequ est, textS tatus, err orThrown)        
167     {        
168      if (err orCallback )        
169       errorC allback(Xm lHttpReque st, textSt atus, erro rThrown);        
170      else        
171       errorH andler(Xml HttpReques t, textSta tus, error Thrown);        
172     }        
173    });        
174   }        
175          
176   function r etrieveMul tiple(odat aSetName,  filter, su ccessCallb ack, error Callback)        
177   {        
178    ///    <s ummary>        
179    ///             Uses  jQuery's  AJAX objec t to call  the Micros oft Dynami cs CRM ODa ta endpoin t to        
180    ///     R etrieve mu ltiple rec ords        
181    ///    </ summary>        
182    /// <para m name="od ataSetName " type="st ring" requ ired="true ">        
183    ///             1: s et -    a  string rep resenting  an OData S et. OData  provides u ri access        
184    ///                   to any CR M entity c ollection.  examples:  AccountSe t, Contact Set,        
185    ///                   Opportuni tySet.         
186    ///    </ param>        
187    /// <para m name="fi lter" type ="string">        
188    ///             1: f ilter - a  string rep resenting  the filter  that is a ppended to  the odata setname        
189    ///                   of the OD ata URI.              
190    ///    </ param>        
191    /// <para m name="su ccessCallb ack" type= "function"  >        
192    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon s uccess        
193    ///                   of the aj ax invocat ion.        
194    ///    </ param>        
195    /// <para m name="er rorCallbac k" type="f unction" >        
196    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon e rror        
197    ///                   of the aj ax invocat ion.        
198    ///    </ param>        
199    //odataSe tName is r equired, i .e. "Accou ntSet"        
200    if (!odat aSetName)        
201    {        
202     alert("o dataSetNam e is requi red.");        
203     return;        
204    }        
205    else        
206    { odataSe tName = en codeURICom ponent(oda taSetName) ; }        
207          
208    //Build t he URI        
209    var odata Uri = clie ntUrl + OD ATA_ENDPOI NT + "/" +  odataSetN ame;        
210          
211    //If a fi lter is su pplied, ap pend it to  the OData  URI        
212    if (filte r)        
213    {        
214     odataUri  += "?$fil ter=" + en codeURICom ponent(fil ter);        
215    }        
216          
217    //Asynchr onous AJAX  function  to Retriev e CRM reco rds using  OData        
218    $.ajax({        
219     type: "G ET",        
220     contentT ype: "appl ication/js on; charse t=utf-8",        
221     datatype : "json",        
222     url: oda taUri,        
223     beforeSe nd: functi on (XMLHtt pRequest)        
224     {        
225      //Speci fying this  header en sures that  the resul ts will be  returned  as JSON.                       
226      XMLHttp Request.se tRequestHe ader("Acce pt", "appl ication/js on");        
227     },        
228     success:  function  (data, tex tStatus, X mlHttpRequ est)        
229     {        
230      if (suc cessCallba ck)        
231      {        
232       if (da ta && data .d && data .d.results )        
233       {        
234        succe ssCallback (data.d.re sults, tex tStatus, X mlHttpRequ est);        
235       }        
236       else i f (data &&  data.d)        
237       {        
238        succe ssCallback (data.d, t extStatus,  XmlHttpRe quest);        
239       }        
240       else        
241       {        
242        succe ssCallback (data, tex tStatus, X mlHttpRequ est);        
243       }        
244      }        
245     },        
246     error: f unction (X mlHttpRequ est, textS tatus, err orThrown)        
247     {        
248      if (err orCallback )        
249       errorC allback(Xm lHttpReque st, textSt atus, erro rThrown);        
250      else        
251       errorH andler(Xml HttpReques t, textSta tus, error Thrown);        
252     }        
253    });        
254   }        
255          
256   function u pdateRecor d(id, enti tyObject,  odataSetNa me, succes sCallback,  errorCall back)        
257   {        
258    ///    <s ummary>        
259    ///             Uses  jQuery's  AJAX objec t to call  the Micros oft Dynami cs CRM ODa ta endpoin t to        
260    ///     u pdate an e xisting re cord        
261    ///    </ summary>        
262    /// <para m name="id " type="gu id" requir ed="true">        
263    ///             1: i d -     th e guid (pr imarykey)  of the rec ord to be  retrieved        
264    ///    </ param>        
265    /// <para m name="en tityObject " type="Ob ject" requ ired="true ">        
266    ///             1: e ntity - a  loose-type  object re presenting  an OData  entity. an y fields        
267    ///                   on this o bject must  be camel- cased and  named exac tly as the        
268    ///                   appear in  entity me tadata        
269    ///    </ param>        
270    /// <para m name="od ataSetName " type="st ring" requ ired="true ">        
271    ///             1: s et -    a  string rep resenting  an OData S et. OData  provides u ri access        
272    ///                   to any CR M entity c ollection.  examples:  AccountSe t, Contact Set,        
273    ///                   Opportuni tySet.         
274    ///    </ param>        
275    /// <para m name="su ccessCallb ack" type= "function"  >        
276    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon s uccess        
277    ///                   of the aj ax invocat ion.        
278    ///    </ param>        
279    /// <para m name="er rorCallbac k" type="f unction" >        
280    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon e rror        
281    ///                   of the aj ax invocat ion.        
282    ///    </ param>        
283          
284    //id is r equired        
285    if (!id)        
286    {        
287     alert("r ecord id i s required .");        
288     return;        
289    }        
290    else        
291    { id = en codeURICom ponent(id) ; }        
292    //odataSe tName is r equired, i .e. "Accou ntSet"        
293    if (!odat aSetName)        
294    {        
295     alert("o dataSetNam e is requi red.");        
296     return;        
297    }        
298    else        
299    { odataSe tName = en codeURICom ponent(oda taSetName) ; }        
300          
301    if (!enti tyObject)        
302    {        
303     alert("e ntityObjec t is requi red.");        
304     return;        
305    }        
306          
307    //Parse t he entity  object int o JSON        
308    var jsonE ntity = wi ndow.JSON. stringify( entityObje ct);        
309          
310    //Asynchr onous AJAX  function  to Update  a CRM reco rd using O Data        
311    $.ajax({        
312     type: "P OST",        
313     contentT ype: "appl ication/js on; charse t=utf-8",        
314     datatype : "json",        
315     data: js onEntity,        
316     url: cli entUrl + O DATA_ENDPO INT + "/"  + odataSet Name + "(g uid'" + id  + "')",        
317     beforeSe nd: functi on (XMLHtt pRequest)        
318     {        
319      //Speci fying this  header en sures that  the resul ts will be  returned  as JSON.                       
320      XMLHttp Request.se tRequestHe ader("Acce pt", "appl ication/js on");        
321          
322      //Speci fy the HTT P method M ERGE to up date just  the change s you are  submitting .                      
323      XMLHttp Request.se tRequestHe ader("X-HT TP-Method" , "MERGE") ;        
324     },        
325     success:  function  (data, tex tStatus, X mlHttpRequ est)        
326     {        
327      //The M ERGE does  not return  any data  at all, so  we'll add  the id         
328      //onto  the data o bject so i t can be l everaged i n a Callba ck. When d ata         
329      //is us ed in the  callback f unction, t he field w ill be nam ed generic ally, "id"        
330      data =  new Object ();        
331      data.id  = id;        
332      if (suc cessCallba ck)        
333      {        
334       succes sCallback( data, text Status, Xm lHttpReque st);        
335      }        
336     },        
337     error: f unction (X mlHttpRequ est, textS tatus, err orThrown)        
338     {        
339      if (err orCallback )        
340       errorC allback(Xm lHttpReque st, textSt atus, erro rThrown);        
341      else        
342       errorH andler(Xml HttpReques t, textSta tus, error Thrown);        
343     }        
344    });        
345   }        
346          
347   function d eleteRecor d(id, odat aSetName,  successCal lback, err orCallback )        
348   {        
349    ///    <s ummary>        
350    ///             Uses  jQuery's  AJAX objec t to call  the Micros oft Dynami cs CRM ODa ta endpoin t to        
351    ///     d elete an e xisting re cord        
352    ///    </ summary>        
353    /// <para m name="id " type="gu id" requir ed="true">        
354    ///             1: i d -     th e guid (pr imarykey)  of the rec ord to be  retrieved        
355    ///    </ param>        
356    /// <para m name="od ataSetName " type="st ring" requ ired="true ">        
357    ///             1: s et -    a  string rep resenting  an OData S et. OData  provides u ri access        
358    ///                   to any CR M entity c ollection.  examples:  AccountSe t, Contact Set,        
359    ///                   Opportuni tySet.         
360    ///    </ param>        
361    /// <para m name="su ccessCallb ack" type= "function"  >        
362    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon s uccess        
363    ///                   of the aj ax invocat ion.        
364    ///    </ param>        
365    /// <para m name="er rorCallbac k" type="f unction" >        
366    ///             1: c allback-a  function t hat can be  supplied  as a callb ack upon e rror        
367    ///                   of the aj ax invocat ion.        
368    ///    </ param>        
369          
370    //id is r equired        
371    if (!id)        
372    {        
373     alert("r ecord id i s required .");        
374     return;        
375    }        
376    else        
377    { id = en codeURICom ponent(id) ; }        
378          
379    //odataSe tName is r equired, i .e. "Accou ntSet"        
380    if (!odat aSetName)        
381    {        
382     alert("o dataSetNam e is requi red.");        
383     return;        
384    }        
385    else        
386    { odataSe tName = en codeURICom ponent(oda taSetName) ; }        
387          
388    //Asynchr onous AJAX  function  to Delete  a CRM reco rd using O Data        
389    $.ajax({        
390     type: "P OST",        
391     contentT ype: "appl ication/js on; charse t=utf-8",        
392     datatype : "json",        
393     url: cli entUrl + O DATA_ENDPO INT + "/"  + odataSet Name + "(g uid'" + id  + "')",        
394     beforeSe nd: functi on (XMLHtt pRequest)        
395     {        
396      //Speci fying this  header en sures that  the resul ts will be  returned  as JSON.                           
397      XMLHttp Request.se tRequestHe ader("Acce pt", "appl ication/js on");        
398          
399      //Speci fy the HTT P method D ELETE to p erform a d elete oper ation.                           
400      XMLHttp Request.se tRequestHe ader("X-HT TP-Method" , "DELETE" );        
401     },        
402     success:  function  (data, tex tStatus, X mlHttpRequ est)        
403     {        
404      if (suc cessCallba ck)        
405      {        
406        succe ssCallback (null, tex tStatus, X mlHttpRequ est);        
407      }        
408     },        
409     error: f unction (X mlHttpRequ est, textS tatus, err orThrown)        
410     {        
411      if (err orCallback )        
412       errorC allback(Xm lHttpReque st, textSt atus, erro rThrown);        
413      else        
414       errorH andler(Xml HttpReques t, textSta tus, error Thrown);        
415     }        
416    });        
417   }        
418          
419   ///     <s ummary>        
420   ///              A fu nction tha t will dis play the e rror resul ts of an A JAX operat ion        
421   ///     </ summary>        
422   function e rrorHandle r(xmlHttpR equest, te xtStatus,  errorThrow n)        
423   {        
424    alert("Er ror : " +  textStatus  + ": " +  xmlHttpReq uest.statu sText);        
425   }