Produced by Araxis Merge on 2/1/2017 2:56:58 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.
| # | 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\JavaScriptRESTRetrieveMultiple\JavaScriptRESTRetrieveMultiple | JavaScriptRESTRetrieveMultiple.htm | Tue Dec 20 19:51:48 2016 UTC |
| 2 | Wed Feb 1 19:56:58 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 124 |
| 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 |
No regular expressions were active.
| 1 | <!DOCTYPE html> | |||||
| 2 | <!--<snipp etJavaScri ptRESTRetr ieveMultip leHTML>--> | |||||
| 3 | <html lang ="en-us"> | |||||
| 4 | <head> | |||||
| 5 | <title>RE ST Endpoin t Paging w ith JScrip t</title> | |||||
| 6 | <meta htt p-equiv="X -UA-Compat ible" cont ent="IE=ed ge" /> | |||||
| 7 | <script s rc="../Cli entGlobalC ontext.js. aspx" type ="text/jav ascript">< /script> | |||||
| 8 | <script s rc="Script s/SDK.REST .js" type= "text/java script"></ script> | |||||
| 9 | <link hre f="Styles/ JavaScript RESTRetrie veMultiple .css" rel= "styleshee t" type="t ext/css" / > | |||||
| 10 | <script t ype="text/ javascript "> | |||||
| 11 | var acco untsGrid; //The tbod y element of the acc ountsTable | |||||
| 12 | var numb erOfAccoun tsToRetrie ve; // The select co ntrol with options f or the num ber of rec ords to re trieve. | |||||
| 13 | var btnR etrieveAcc ounts; //T he button to retriev e accounts | |||||
| 14 | var acco untsRetrie ved; //The span disp laying the number of account r ecords ret rieved. | |||||
| 15 | var succ essMessage ; // The m essage dis played whe n records are return ed. | |||||
| 16 | var tota lAccountCo unt = 0; | |||||
| 17 | document .onreadyst atechange = function () { | |||||
| 18 | if (doc ument.read yState == "complete" ) { | |||||
| 19 | btnRet rieveAccou nts = docu ment.getEl ementById( "btnRetrie veAccounts "); | |||||
| 20 | accoun tsGrid = d ocument.ge tElementBy Id("accoun tsGrid"); | |||||
| 21 | number OfAccounts ToRetrieve = documen t.getEleme ntById("nu mberOfAcco untsToRetr ieve"); | |||||
| 22 | accoun tsRetrieve d = docume nt.getElem entById("a ccountsRet rieved"); | |||||
| 23 | succes sMessage = document. getElement ById("succ essMessage "); | |||||
| 24 | btnRet rieveAccou nts.onclic k = retrie veAccounts ; | |||||
| 25 | btnRet rieveAccou nts.click( ); | |||||
| 26 | } | |||||
| 27 | } | |||||
| 28 | function retrieveA ccounts() { | |||||
| 29 | ///<sum mary> | |||||
| 30 | /// Ret rieves acc ounts by p assing a f ilter to t he SDK.Res tEndpointP aging.Retr ieveRecord s function | |||||
| 31 | ///</su mmary> | |||||
| 32 | clearac countsGrid (); | |||||
| 33 | var num ber = pars eInt(numbe rOfAccount sToRetriev e.options[ numberOfAc countsToRe trieve.sel ectedIndex ].value, 1 0); | |||||
| 34 | var opt ions = "$s elect=Name ,Telephone 1&$top=" + number; | |||||
| 35 | //The r etrieveAcc ountsCallB ack functi on is pass ed through as the su ccessCallB ack. | |||||
| 36 | SDK.RES T.retrieve MultipleRe cords("Acc ount", opt ions, retr ieveAccoun tsCallBack , function (error) { alert(err or.message ); }, acco untsRetrie veComplete ); | |||||
| 37 | } | |||||
| 38 | function retrieveA ccountsCal lBack(retr ievedAccou nts) { | |||||
| 39 | ///<sum mary> | |||||
| 40 | /// Thi s function is passed through t he request and is it erated for each page of data | |||||
| 41 | /// Thi s function appends r ows to the accountsG rid. | |||||
| 42 | ///</su mmary> | |||||
| 43 | totalAc countCount = totalAc countCount + retriev edAccounts .length; | |||||
| 44 | for (va r i = 0; i < retriev edAccounts .length; i ++) { | |||||
| 45 | var ac count = re trievedAcc ounts[i]; | |||||
| 46 | var ro w = docume nt.createE lement("tr "); | |||||
| 47 | var na meCell = d ocument.cr eateElemen t("td"); | |||||
| 48 | setEle mentText(n ameCell, a ccount.Nam e); | |||||
| 49 | row.ap pendChild( nameCell); | |||||
| 50 | var ma inPhoneCel l = docume nt.createE lement("td "); | |||||
| 51 | setEle mentText(m ainPhoneCe ll, (accou nt.Telepho ne1 == nul l) ? "" : account.Te lephone1); | |||||
| 52 | mainPh oneCell.cl assName = "rightColu mn"; | |||||
| 53 | row.ap pendChild( mainPhoneC ell); | |||||
| 54 | accoun tsGrid.app endChild(r ow); | |||||
| 55 | } | |||||
| 56 | } | |||||
| 57 | function accountsR etrieveCom plete() { | |||||
| 58 | ///<sum mary> | |||||
| 59 | /// Thi s function is called after all the recor ds have be en returne d to updat e the actu al total n umber of r ecords. | |||||
| 60 | ///</su mmary> | |||||
| 61 | account sRetrieved .innerText = totalAc countCount ; | |||||
| 62 | success Message.st yle.displa y = "block "; | |||||
| 63 | } | |||||
| 64 | function clearacco untsGrid() { | |||||
| 65 | ///<sum mary> | |||||
| 66 | /// Thi s function initializ es the tot alAccountC ount and clears all the rows from the a ccountsGri d | |||||
| 67 | /// in preparatio n for addi ng a new s et of rows . | |||||
| 68 | ///</su mmary> | |||||
| 69 | success Message.st yle.displa y = "none" ; | |||||
| 70 | totalAc countCount = 0; | |||||
| 71 | for (va r i = acco untsGrid.r ows.length - 1; i >= 0; i--) { | |||||
| 72 | accoun tsGrid.del eteRow(i); | |||||
| 73 | } | |||||
| 74 | } | |||||
| 75 | function setElemen tText(elem ent, text) { | |||||
| 76 | ///<sum mary> | |||||
| 77 | /// Thi s function mitigates the fact that IE us es innerTe xt and oth er browser s use text Content. | |||||
| 78 | ///</su mmary> | |||||
| 79 | if (typ eof (eleme nt.innerTe xt) != "un defined") | |||||
| 80 | { eleme nt.innerTe xt = text; } | |||||
| 81 | else | |||||
| 82 | { eleme nt.textCon tent = tex t; } | |||||
| 83 | } | |||||
| 84 | </script> | |||||
| 85 | </head> | |||||
| 86 | <body> | |||||
| 87 | <table id ="tableHea dings" sum mary="This table pro vides the headings f or the lis t of accou nts displa yed in a g rid."> | |||||
| 88 | <thead> | |||||
| 89 | <tr> | |||||
| 90 | <th cl ass="leftC olumn"> | |||||
| 91 | Accou nt Name | |||||
| 92 | </th> | |||||
| 93 | <th cl ass="right Column"> | |||||
| 94 | Main Phone | |||||
| 95 | </th> | |||||
| 96 | </tr> | |||||
| 97 | </thead> | |||||
| 98 | </table> | |||||
| 99 | <div id=" tableConta iner"> | |||||
| 100 | <table i d="account sTable" ru les="group s" summary ="This tab le display s the acco unts retri eved."> | |||||
| 101 | <tbody id="accoun tsGrid" /> | |||||
| 102 | </table> | |||||
| 103 | </div> | |||||
| 104 | <div id=" controlsCo ntainer"> | |||||
| 105 | <div> | |||||
| 106 | <span>M aximum Num ber of Acc ounts to R etrieve: | |||||
| 107 | <selec t id="numb erOfAccoun tsToRetrie ve"> | |||||
| 108 | <opti on value=" 10" select ed="select ed">10</op tion> | |||||
| 109 | <opti on value=" 100" selec ted="selec ted">100</ option> | |||||
| 110 | <opti on value=" 300">300</ option> | |||||
| 111 | <opti on value=" 600">600</ option> | |||||
| 112 | <opti on value=" 900">900</ option> | |||||
| 113 | </sele ct> | |||||
| 114 | <butto n id="btnR etrieveAcc ounts"> | |||||
| 115 | Retri eve Accoun ts</button > | |||||
| 116 | </span> | |||||
| 117 | </div> | |||||
| 118 | <div id= "successMe ssage" sty le="displa y: none;"> | |||||
| 119 | Total N umber of A ccounts Re trieved : <span id=" accountsRe trieved">< /span> | |||||
| 120 | </div> | |||||
| 121 | </div> | |||||
| 122 | </body> | |||||
| 123 | </html> | |||||
| 124 | <!--</snip petJavaScr iptRESTRet rieveMulti pleHTML>-- > |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.