My collection of useful Quickbase Snippets
var dbidp = "your dbidp";
var qidp = "your qidp"
var dbidc = "your dbidc";
var related_parent_fid_c = "your related parent fid";
var promisep, promisec;
promisep = $.post(dbid1,{
act:"API_PurgeRecords",
qid: qidp
});
$.when(promisep).then(function(){
promisec = $.post(dbid2,{
act:"API_PurgeRecords",
query: "{'" + related_parent_fid_c + "'.XEX.''}"
});
});
$.when(promisec).then(function(){
alert("parent and child records deleted");
});
var dbid = "";
var apptoken = "";
$.ajaxSetup({data: {apptoken: apptoken}});
$.get(dbid, {
act: "API_DoQuery",
qid: "1",
clist: "3",
slist: "3",
options: "sortorder-D.num-1"
}).then(function(xml) {
var maxRid = $("record_id_", xml).text();
console.log(maxRid);
});
-> coined by Nathan Thompson of WEG (https://azastudio.net/consulting-1/2016/12/26/creating-tabs-in-quickbase)
This technique is similar to the image on load technique
Name | Value |
---|---|
of | <img style='Display:None' src=' ' id='canTarget' onerror="javascript:$.getScript(gReqAppDBID+'?a=dbpage&pagename= |
/of | ');"> |
[of] & "customCodePage.js" & [/of]
(function(){
var querystring=document.location.search;
if (/dlta=mog/i.test(querystring)) {
//GRID EDIT PAGE ========================================
//alert("You are on the Grid Edit Page");
} else if(/a=er/i.test(querystring)) {
//EDIT RECORD PAGE ========================================
//alert("You are on the Edit Record Page");
} else if (/a=API_GenAddRecordForm/i.test(querystring)) {
//API_GenAddRecordForm PAGE ========================================
//alert("You are on the GenAddRecordForm Page!");
} else if (/GenNewRecord/i.test(querystring)) {
//ADD RECORD PAGE ========================================
//alert("You are on the Add Record Page");
} else if (/nwr/i.test(querystring)) {
//ADD RECORD PAGE ========================================
alert("You are on the Add Record Page");
var markup = "";
markup += "<ul>";
$("#formContents div.sectionDiv").each(function(index){
markup += "<li><a href='#tab_" + (index+1) + "'>" + $("span.sectionTitle",this).text() + "</a></li>";
});
markup += "</ul>";
$("#formContents").prepend(markup);
$("#formContents div.sectionDiv").each(function(index){
$(this).attr("id","tab_" + (index+1));
$("div:lt(2)",this).hide();
});
$("#formContents").tabs();
} else if(/a=dr/i.test(querystring)) {
//DISPLAY RECORD PAGE
//alert("You are on the Display Record Page");
$("img[qbu=module]").closest("td").css("background-color","#FFFFFF");
} else if(/a=q/i.test(querystring)) {
//REPORT PAGE ========================================
//alert("You are on the Report Listing Page");
} else if(/a=td/i.test(querystring)) {
//TABLE DASHBOARD PAGE ========================================
//alert("You are on the Table Dashboard Page");
} else {
//OTHER PAGE ========================================
//alert("You are on the Some Other Page");
}
})();
fetch('./api/some.json')
.then(
function(response) {
if (response.status !== 200) {
console.log('Looks like there was a problem. Status Code: ' +
response.status);
return;
}
// Examine the text in the response
response.json().then(function(data) {
console.log(data);
});
}
)
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
"<img src=\"/i/spacer.gif\" onload=\"$.getScript('?a=dbpage&pageName=script.js');\">"
👍 👍 👍👍
All rights reserved. Some of the code in this page is copyright by Dan Diebolt (734-985-0721) (dandiebolt@yahoo.com).