Forum Discussion
SystemAdmin7
5 years agoQrew Cadet
Alas, it looks like there was an update.
From QB:
"If your implementation includes relying on our internal libraries, those would need to be upgraded as we do not support those techniques. For the most stable and supportable Quick Base implementation, we suggest only using native or support methodologies. As a best practice to custom interfaces, developers should host, maintain and upgrade their own libraries. I believe that is what you are seeing here. The libraries have been recently updated and now your JavaScript cannot find the jQuery library that it was previously using."
Anybody know how to update this code below to work with their updates? I wish I could use only native functions, but those seem to be lacking in several areas.
Here's my IOL for the second two scripts (the ones that aren't working)
------------------------------
Amanda Luna
------------------------------
From QB:
"If your implementation includes relying on our internal libraries, those would need to be upgraded as we do not support those techniques. For the most stable and supportable Quick Base implementation, we suggest only using native or support methodologies. As a best practice to custom interfaces, developers should host, maintain and upgrade their own libraries. I believe that is what you are seeing here. The libraries have been recently updated and now your JavaScript cannot find the jQuery library that it was previously using."
Anybody know how to update this code below to work with their updates? I wish I could use only native functions, but those seem to be lacking in several areas.
//creates colorized rows in Sales appointments --> Sales Log $("table.searchResults tr.ev").css({backgroundColor: "#f2f2f2"}); //concatenates and adds interactions notes to the sales log (function(){ $("img[qbu=module]").remove(); //parameters: var dbid = "XXXXX"; var dbidParents = "XXXXX"; // Homeowner contact details var dbidChilds = "XXXXXX"; // Interactions var apptoken = "XXXXXXXX"; var n = 100; var relatedParentFid = "6"; var relatedParentLabel = "related_contact"; var clist = "6.12.135.136.138"; var slist = "1"; var options = "sortorder-D"; var qbuClass = "QBU_Childs"; var template = "<ul style=list-style-type:none>{{#.}}<li><br><small><i>{{date_created}} <br>{{record_owner}}</small></i> <br>{{conversation_details}} </li>{{/.}}</ul>"; $.ajaxSetup({data: {apptoken: apptoken}}); var rids = $("div.QBU_Childs").map(function() { return this.dataset.rid; }).get(); _.chain(rids).groupBy(function(element, index){ return Math.floor(index/n); }).toArray().each(function(rids, index) { $.ajax({ url: dbidChilds, data: { act: "API_DoQuery", clist: clist, slist: slist, options: options, query: ridsToQuery(rids, relatedParentFid) }, dataFilter: XMLFlatToObj }).then(function(resp) { _.chain(resp.records).groupBy(function(items) { return items[relatedParentLabel]; }).each(function(item, rid) { var markup = Mustache.render(template, item); $("div." + qbuClass + "[data-rid=" + rid + "]").html(markup); }); }); }); function XMLFlatToObj(xml, type) { var data = []; var record = {}; $("record", xml).each(function() { record = {}; $(this).children().each(function () { record[$(this).prop("tagName")] = $(this).text(); }); data.push(record); }); return {records: data}; } function ridsToQuery(rids, fid) { fid = fid || "3"; return "{" + fid + ".EX." + rids.join("}OR{" + fid + ".EX.") + "}AND({78.EX.No Sale}OR{78.EX.Full Demo}OR{78.EX.Sold}OR{78.EX.Reload})"; } })(); //concatenates and adds field notes to the sales log (function(){ $("img[qbu=module]").remove(); //parameters: var dbid = "XXXXXX"; var dbidParents = "XXXXXX"; // homeowner contact details var dbidChilds2 = "XXXXXX"; //sales appointments var apptoken = "XXXXXXXXXX"; var n = 100; var relatedParentFid = "14"; var relatedParentLabel = "related_contact"; var clist = "14.106.104.105.102.100"; var slist = "1"; var options = "sortorder-D"; var qbuClass = "QBU_Childs2"; var template = "<ul style=list-style-type:none>{{#.}}<li><i><small>{{date_modified}}<br>Appointment Date: {{appointment_date}}<br>Created by: {{record_owner}}<br></i></small>{{{field_notes}}}<br><br></li>{{/.}}</ul>"; $.ajaxSetup({data: {apptoken: apptoken}}); var rids = $("div.QBU_Childs2").map(function() { return this.dataset.rid; }).get(); _.chain(rids).groupBy(function(element, index){ return Math.floor(index/n); }).toArray().each(function(rids, index) { $.ajax({ url: dbidChilds2, data: { act: "API_DoQuery", clist: clist, slist: slist, options: options, query: ridsToQuery(rids, relatedParentFid) }, dataFilter: XMLFlatToObj }).then(function(resp) { _.chain(resp.records).groupBy(function(items) { return items[relatedParentLabel]; }).each(function(item, rid) { var markup = Mustache.render(template, item); $("div." + qbuClass + "[data-rid=" + rid + "]").html(markup); }); }); }); function XMLFlatToObj(xml, type) { var data = []; var record = {}; $("record", xml).each(function() { record = {}; $(this).children().each(function () { record[$(this).prop("tagName")] = $(this).text(); }); data.push(record); }); return {records: data}; } function ridsToQuery(rids, fid) { fid = fid || "14"; return "{" + fid + ".EX." + rids.join("}OR{" + fid + ".EX.") + "}"; } })();​
Here's my IOL for the second two scripts (the ones that aren't working)
iol
<img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=
/iol
&rand='+new Date().getTime())};"> ​
------------------------------
Amanda Luna
------------------------------