Forum Discussion
_anomDiebolt_
10 years agoQrew Elite
John>How about detecting if the user hits delete record? Can that be detected? and say get record id and user who did it?
You should probably pursue QuickBase's Web Hook feature for this.
I put together this handy dandy Venn Diagram to explain what can be done with JavaScript versus Native QuickBase:
http://i.imgur.com/2psdwVK.jpg
Using the image onload technique you can redefine QuickBase's DoDelete() function to log the deletion to your own table using code similar to this:
function DoDelete(nounSingular, dbid, rid) {
var doHandleChecked = function() {
kIsDelete = true;
var dbidLog = "<your dbid>";
var apptoken="<your apptoken>";
$.ajaxSetup({data: {apptoken: apptoken}});
$.post(dbidLog, {
act: "API_AddRecord",
_fid_6: rid,
_fid_7: dbid
}).then(function() {
SetLocation(dbid + "?a=DoDeleteRecord&rid=" + rid + "&rl=" + GetValue("rl") + "&PageToken=" + GetValue("PageToken"));
$(this).dialog("close")
});
};
var msg = "<p>Are you sure you want to delete this " + nounSingular + "?<p>";
QB.Dialog.confirm({
title: "Delete " + nounSingular + "?",
type: "Warning",
size: "medium",
contents: msg,
contentType: "html",
id: "dialogConfirmDeleteRecord",
confirm: {
text: "Delete",
type: "Danger",
click: doHandleChecked
}
})
}
You should probably pursue QuickBase's Web Hook feature for this.
I put together this handy dandy Venn Diagram to explain what can be done with JavaScript versus Native QuickBase:
http://i.imgur.com/2psdwVK.jpg
Using the image onload technique you can redefine QuickBase's DoDelete() function to log the deletion to your own table using code similar to this:
function DoDelete(nounSingular, dbid, rid) {
var doHandleChecked = function() {
kIsDelete = true;
var dbidLog = "<your dbid>";
var apptoken="<your apptoken>";
$.ajaxSetup({data: {apptoken: apptoken}});
$.post(dbidLog, {
act: "API_AddRecord",
_fid_6: rid,
_fid_7: dbid
}).then(function() {
SetLocation(dbid + "?a=DoDeleteRecord&rid=" + rid + "&rl=" + GetValue("rl") + "&PageToken=" + GetValue("PageToken"));
$(this).dialog("close")
});
};
var msg = "<p>Are you sure you want to delete this " + nounSingular + "?<p>";
QB.Dialog.confirm({
title: "Delete " + nounSingular + "?",
type: "Warning",
size: "medium",
contents: msg,
contentType: "html",
id: "dialogConfirmDeleteRecord",
confirm: {
text: "Delete",
type: "Danger",
click: doHandleChecked
}
})
}