Produced by Araxis Merge on 5/9/2017 12:03:03 PM Eastern Daylight 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 | Tue May 9 16:03:03 2017 UTC | ||
| 2 | OSCIF_HEC_v1.4_Sprint23_build4_Apr_2017.zip\CRM_solutions\Managed\North52BPA_1_0_0_506_managed_2013_2015_2016..zip\WebResources | north52_javascriptformulatestF4949DB0-6266-E211-BEE9-00155DF5B00D | Mon Sep 19 18:20:18 2016 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 293 |
| Removed | 0 | 0 |
| 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 | if (typeof North52 = = 'undefin ed') { Nor th52 = {}; } | |||||
| 2 | if (typeof North52.F ormulaTest == 'undef ined') { N orth52.For mulaTest = {}; } | |||||
| 3 | ||||||
| 4 | North52.Fo rmulaTest. FormulaNam e = ""; | |||||
| 5 | North52.Fo rmulaTest. FormulaPar ameterXml = ""; | |||||
| 6 | North52.Fo rmulaTest. EntityName = ""; | |||||
| 7 | ||||||
| 8 | North52.Fo rmulaTest. Ok = funct ion () { | |||||
| 9 | ||||||
| 10 | $('#lo ading').sh ow(); | |||||
| 11 | var ta rgetId = " "; | |||||
| 12 | ||||||
| 13 | North5 2.FormulaT est.BuildP arametersX ml(); | |||||
| 14 | ||||||
| 15 | var op tions = "$ select=nor th52_Resul t&$filter= north52_na me eq " + "'" + Nort h52.Formul aTest.Form ulaShortCo de + "' an d north52_ Parameters eq '" + N orth52.For mulaTest.F ormulaPara meterXml + "' and no rth52_Targ etEntityID eq '" + t argetId + "' and nor th52_Formu laType eq '99'"; | |||||
| 16 | ||||||
| 17 | SDK.RE ST.retriev eMultipleR ecords("no rth52_form ulacalcula tion", | |||||
| 18 | options , | |||||
| 19 | North52 .FormulaTe st.retriev eMultipleR ecordsSucc ess, | |||||
| 20 | functio n (error) { North52. FormulaTes t.DisplayM essage(err or.message , "Red"); $('#loadin g').hide() ; }, | |||||
| 21 | North52 .FormulaTe st.retriev eMultipleR ecordsErro r) | |||||
| 22 | }; | |||||
| 23 | ||||||
| 24 | North52.Fo rmulaTest. retrieveMu ltipleReco rdsSuccess = functio n (retriev edResult) { | |||||
| 25 | ||||||
| 26 | try { | |||||
| 27 | va r displayR esult = '' ; | |||||
| 28 | ||||||
| 29 | if (retrieve dResult == null) | |||||
| 30 | displayR esult = "A n internal failure h as occurre d. Please enable ser ver side t racing & c heck the N 52 Trace L og entity. "; | |||||
| 31 | el se { | |||||
| 32 | var form ulaResult = retrieve dResult[0] ; | |||||
| 33 | ||||||
| 34 | if (form ulaResult. north52_Re sult == 'N oOp') | |||||
| 35 | disp layResult = 'No Oper ation'; | |||||
| 36 | else { | |||||
| 37 | var result = J SON.parse( formulaRes ult.north5 2_Result); | |||||
| 38 | disp layResult = result.P ropertyVal ueAction; | |||||
| 39 | } | |||||
| 40 | } | |||||
| 41 | No rth52.Form ulaTest.Di splayMessa ge("Formul a Result: " + displa yResult, " Green"); | |||||
| 42 | $( '#loading' ).hide(); | |||||
| 43 | ||||||
| 44 | } | |||||
| 45 | ||||||
| 46 | catch (ex) { | |||||
| 47 | al ert('North 52 Formula Manager E rror: ' + ex.message ); | |||||
| 48 | } | |||||
| 49 | }; | |||||
| 50 | ||||||
| 51 | North52.Fo rmulaTest. retrieveMu ltipleReco rdsError = function (XmlHttpRe quest, tex tStatus, e rrorThrown ) { | |||||
| 52 | ||||||
| 53 | }; | |||||
| 54 | ||||||
| 55 | North52.Fo rmulaTest. BuildParam etersXml = function () { | |||||
| 56 | ||||||
| 57 | North5 2.FormulaT est.Formul aParameter Xml = ""; | |||||
| 58 | var al lInputs = $(":input[ type=text] "); | |||||
| 59 | ||||||
| 60 | for (v ar i = 0; i < allInp uts.length ; i++) { | |||||
| 61 | No rth52.Form ulaTest.Fo rmulaParam eterXml += North52.F ormulaTest .GetXmlEle ment(allIn puts[i].na me, allInp uts[i].val ue); | |||||
| 62 | } | |||||
| 63 | ||||||
| 64 | North5 2.FormulaT est.Formul aParameter Xml = "<" + North52. FormulaTes t.EntityNa me + ">" + North52.F ormulaTest .FormulaPa rameterXml + "</" + North52.Fo rmulaTest. EntityName + ">"; | |||||
| 65 | North5 2.FormulaT est.Formul aParameter Xml = Nort h52.Formul aTest.Html Decode(Nor th52.Formu laTest.For mulaParame terXml); | |||||
| 66 | ||||||
| 67 | }; | |||||
| 68 | ||||||
| 69 | North52.Fo rmulaTest. GetXmlElem ent = func tion (elem entName, e lementValu e) { | |||||
| 70 | ||||||
| 71 | return "<" + ele mentName + ">" + ele mentValue + "</" + e lementName + ">"; | |||||
| 72 | ||||||
| 73 | }; | |||||
| 74 | ||||||
| 75 | North52.Fo rmulaTest. OnLoad = f unction () { | |||||
| 76 | $('#lo ading').hi de(); | |||||
| 77 | var re cordid = N 52.DialogH elpers.Get ParameterB yName('id' ); | |||||
| 78 | ||||||
| 79 | ||||||
| 80 | SDK.RE ST.retriev eRecord(re cordid, | |||||
| 81 | "north52_f ormula", | |||||
| 82 | null, | |||||
| 83 | null, | |||||
| 84 | North52. FormulaTes t.Retrieve RecordSucc ess, | |||||
| 85 | function (error) { alert("No rth52 Form ula Manage r: " + err or.message ); }, | |||||
| 86 | North52. FormulaTes t.Retrieve RecordErro r | |||||
| 87 | ) | |||||
| 88 | ||||||
| 89 | }; | |||||
| 90 | ||||||
| 91 | North52.Fo rmulaTest. RetrieveRe cordSucces s = functi on (retrie vedFormula ) { | |||||
| 92 | ||||||
| 93 | var tx tarea = re trievedFor mula.north 52_Formula Descriptio n; | |||||
| 94 | txtare a = txtare a.replace( /\/\*[\s\S ]*?\*\/|([ ^:]|^)\/\/ .*$/gm, '$ 1'); | |||||
| 95 | txtare a = txtare a.replace( /\«(.*?)\» /, ''); | |||||
| 96 | txtare a = txtare a.replace( /\«(.*?)\» /, ''); | |||||
| 97 | txtare a = txtare a.replace( /\«(.*?)\» /, ''); | |||||
| 98 | txtare a = txtare a.replace( /\«(.*?)\» /, ''); | |||||
| 99 | txtare a = txtare a.replace( /\«(.*?)\» /, ''); | |||||
| 100 | ||||||
| 101 | ||||||
| 102 | var pa rameters = North52.F ormulaTest .GetParame ters(txtar ea); | |||||
| 103 | North5 2.FormulaT est.BuildP arameters( parameters ); | |||||
| 104 | ||||||
| 105 | North5 2.FormulaT est.Formul aShortCode = retriev edFormula. north52_Sh ortCode; | |||||
| 106 | North5 2.FormulaT est.Entity Name = ret rievedForm ula.north5 2_SourceEn tityName; | |||||
| 107 | }; | |||||
| 108 | ||||||
| 109 | North52.Fo rmulaTest. RetrieveRe cordError = function (XmlHttpR equest, te xtStatus, errorThrow n) { | |||||
| 110 | alert( 'North52 F ormula Man ager: ' + XmlHttpReq uest.messa ge) | |||||
| 111 | ||||||
| 112 | }; | |||||
| 113 | ||||||
| 114 | ||||||
| 115 | North52.Fo rmulaTest. GetParamet ers = func tion (str) { | |||||
| 116 | ||||||
| 117 | var my Array = st r.match(/\ [(.*?)\]/g ); | |||||
| 118 | ||||||
| 119 | return North52.F ormulaTest .UniqueArr ay(myArray ); | |||||
| 120 | ||||||
| 121 | }; | |||||
| 122 | ||||||
| 123 | North52.Fo rmulaTest. UniqueArra y = functi on (arr) { | |||||
| 124 | ||||||
| 125 | var ha sh = {}, r esult = [] ; | |||||
| 126 | ||||||
| 127 | if (ar r == null) | |||||
| 128 | re turn arr; | |||||
| 129 | else { | |||||
| 130 | fo r (var i = 0, l = ar r.length; i < l; ++i ) { | |||||
| 131 | if (!has h.hasOwnPr operty(arr [i])) { | |||||
| 132 | hash [arr[i]] = true; | |||||
| 133 | resu lt.push(ar r[i]); | |||||
| 134 | } | |||||
| 135 | } | |||||
| 136 | re turn resul t; | |||||
| 137 | } | |||||
| 138 | ||||||
| 139 | ||||||
| 140 | }; | |||||
| 141 | ||||||
| 142 | North52.Fo rmulaTest. BuildParam eters = fu nction (pa rameters) { | |||||
| 143 | ||||||
| 144 | if (pa rameters = = null) { | |||||
| 145 | No rth52.Form ulaTest.Di splayMessa geHeader(" No paramet ers detect ed. The fo rmula will be execut ed as is." ); | |||||
| 146 | ||||||
| 147 | va r table = document.g etElementB yId("north 52_paramet erList"); | |||||
| 148 | va r header = document. createElem ent("thead "); | |||||
| 149 | va r headerRo w = docume nt.createE lement("tr "); | |||||
| 150 | he ader.appen dChild(hea derRow); | |||||
| 151 | ||||||
| 152 | va r tableBod y = docume nt.createE lement("tb ody"); | |||||
| 153 | ta bleBody.id = "north5 2tbody"; | |||||
| 154 | ta ble.append Child(head er); | |||||
| 155 | ||||||
| 156 | ta ble.append Child(tabl eBody); | |||||
| 157 | ||||||
| 158 | va r paramete r = " "; | |||||
| 159 | va r row = do cument.cre ateElement ("tr"); | |||||
| 160 | ro w.id = "ro w1"; | |||||
| 161 | ||||||
| 162 | va r cell = d ocument.cr eateElemen t("td"); | |||||
| 163 | va r displayE lement = d ocument.cr eateElemen t("span"); | |||||
| 164 | di splayEleme nt.innerTe xt = param eter; | |||||
| 165 | ce ll.appendC hild(displ ayElement) ; | |||||
| 166 | ro w.appendCh ild(cell); | |||||
| 167 | ||||||
| 168 | va r cell2 = document.c reateEleme nt("td"); | |||||
| 169 | va r displayE lement2 = document.c reateEleme nt("span") ; | |||||
| 170 | di splayEleme nt2.innerT ext = para meter; | |||||
| 171 | ce ll2.append Child(disp layElement 2); | |||||
| 172 | ro w.appendCh ild(cell2) ; | |||||
| 173 | ||||||
| 174 | ta bleBody.ap pendChild( row); | |||||
| 175 | ||||||
| 176 | ta ble.append Child(tabl eBody); | |||||
| 177 | ||||||
| 178 | } | |||||
| 179 | else { | |||||
| 180 | ||||||
| 181 | ||||||
| 182 | va r table = document.g etElementB yId("north 52_paramet erList"); | |||||
| 183 | va r header = document. createElem ent("thead "); | |||||
| 184 | va r headerRo w = docume nt.createE lement("tr "); | |||||
| 185 | he aderRow.he ight = "12 px"; | |||||
| 186 | he ader.appen dChild(hea derRow); | |||||
| 187 | ||||||
| 188 | va r tableBod y = docume nt.createE lement("tb ody"); | |||||
| 189 | ta bleBody.id = "north5 2tbody"; | |||||
| 190 | ta ble.append Child(head er); | |||||
| 191 | ||||||
| 192 | ||||||
| 193 | ta ble.append Child(tabl eBody); | |||||
| 194 | ||||||
| 195 | fo r (var i = 0; i < pa rameters.l ength; i++ ) { | |||||
| 196 | var para meter = pa rameters[i ]; | |||||
| 197 | var row = document .createEle ment("tr") ; | |||||
| 198 | row.id = "row" + i ; | |||||
| 199 | row.heig ht = "12px "; | |||||
| 200 | var cell = documen t.createEl ement("td" ); | |||||
| 201 | var disp layElement = documen t.createEl ement("spa n"); | |||||
| 202 | displayE lement.inn erText = p arameter; | |||||
| 203 | cell.app endChild(d isplayElem ent); | |||||
| 204 | row.appe ndChild(ce ll); | |||||
| 205 | ||||||
| 206 | var cell 2 = docume nt.createE lement("td "); | |||||
| 207 | var inpu tElement = document. createElem ent("input "); | |||||
| 208 | inputEle ment.type = "text"; | |||||
| 209 | inputEle ment.name = paramete r.replace( '[', "").r eplace(']' , "").spli t('.')[1]; | |||||
| 210 | ||||||
| 211 | cell2.ap pendChild( inputEleme nt); | |||||
| 212 | row.appe ndChild(ce ll2); | |||||
| 213 | tableBod y.appendCh ild(row); | |||||
| 214 | ||||||
| 215 | ||||||
| 216 | ||||||
| 217 | } | |||||
| 218 | No rth52.Form ulaTest.Di splayMessa geHeader(" Parameters detected, please se t values." ); | |||||
| 219 | ta ble.append Child(tabl eBody); | |||||
| 220 | } | |||||
| 221 | }; | |||||
| 222 | ||||||
| 223 | ||||||
| 224 | North52.Fo rmulaTest. DisplayMes sage = fun ction (mes sageText, colour) { | |||||
| 225 | var ul = documen t.getEleme ntById("me ssage"); | |||||
| 226 | var li = documen t.createEl ement("li" ); | |||||
| 227 | var di v = docume nt.createE lement("di v"); | |||||
| 228 | var me ssageSpan = document .createEle ment("span "); | |||||
| 229 | messag eSpan.inne rText = me ssageText; | |||||
| 230 | div.ap pendChild( messageSpa n); | |||||
| 231 | li.app endChild(d iv); | |||||
| 232 | ul.app endChild(l i); | |||||
| 233 | $('#me ssage').cs s("color", colour); | |||||
| 234 | ||||||
| 235 | }; | |||||
| 236 | ||||||
| 237 | North52.Fo rmulaTest. DisplayMes sageHeader = functio n (message Text) { | |||||
| 238 | var ul = documen t.getEleme ntById("me ssageHeade r"); | |||||
| 239 | var li = documen t.createEl ement("li" ); | |||||
| 240 | var di v = docume nt.createE lement("di v"); | |||||
| 241 | var me ssageSpan = document .createEle ment("span "); | |||||
| 242 | messag eSpan.inne rText = me ssageText; | |||||
| 243 | div.ap pendChild( messageSpa n); | |||||
| 244 | li.app endChild(d iv); | |||||
| 245 | ul.app endChild(l i); | |||||
| 246 | ||||||
| 247 | }; | |||||
| 248 | ||||||
| 249 | ||||||
| 250 | North52.Fo rmulaTest. HtmlDecode = functio n (s) { | |||||
| 251 | var ou t = ""; | |||||
| 252 | if (s == null) r eturn; | |||||
| 253 | ||||||
| 254 | var l = s.length ; | |||||
| 255 | for (v ar i = 0; i < l; i++ ) { | |||||
| 256 | va r ch = s.c harAt(i); | |||||
| 257 | ||||||
| 258 | if (ch == '& ') { | |||||
| 259 | var semi colonIndex = s.index Of(';', i + 1); | |||||
| 260 | ||||||
| 261 | if (semi colonIndex > 0) { | |||||
| 262 | var entity = s .substring (i + 1, se micolonInd ex); | |||||
| 263 | if ( entity.len gth > 1 && entity.ch arAt(0) == '#') { | |||||
| 264 | if (entity .charAt(1) == 'x' || entity.ch arAt(1) == 'X') | |||||
| 265 | ch = S tring.from CharCode(e val('0' + entity.sub string(1)) ); | |||||
| 266 | else | |||||
| 267 | ch = S tring.from CharCode(e val(entity .substring (1))); | |||||
| 268 | } | |||||
| 269 | else { | |||||
| 270 | switch (en tity) { | |||||
| 271 | case ' quot': ch = String.f romCharCod e(0x0022); break; | |||||
| 272 | case ' amp': ch = String.fr omCharCode (0x0026); break; | |||||
| 273 | case ' lt': ch = String.fro mCharCode( 0x003c); b reak; | |||||
| 274 | case ' gt': ch = String.fro mCharCode( 0x003e); b reak; | |||||
| 275 | case ' nbsp': ch = String.f romCharCod e(0x00a0); break; | |||||
| 276 | case ' iexcl': ch = String. fromCharCo de(0x00a1) ; break; | |||||
| 277 | case ' cent': ch = String.f romCharCod e(0x00a2); break; | |||||
| 278 | case ' pound': ch = String. fromCharCo de(0x00a3) ; break; | |||||
| 279 | case ' curren': c h = String .fromCharC ode(0x00a4 ); break; | |||||
| 280 | ||||||
| 281 | defaul t: ch = '' ; break; | |||||
| 282 | } | |||||
| 283 | } | |||||
| 284 | i = semicolonI ndex; | |||||
| 285 | } | |||||
| 286 | } | |||||
| 287 | ||||||
| 288 | ou t += ch; | |||||
| 289 | } | |||||
| 290 | ||||||
| 291 | return out; | |||||
| 292 | ||||||
| 293 | }; |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.