Forum Discussion
RebeccaGoetz
8 years agoQrew Member
Hi, I've gone through this thread and while it's been immensely helpful I still can't get this to work for me. Here is my code:
$("#_fid_17").attr("readonly", "readonly");
var label, oldValue, newValue, log;
$("#_fid_6, #_fid_7, #_fid_8").on("change", function() {
log = [];
_.each([6, 7, 8], function(fid) {
oldValue = $("[name=_fid_oval_" + fid + "]").val();
newValue = $("#_fid_" + fid).val();
if (oldValue != newValue) {
label = $("label[for=_fid_" + fid + "]").text();
log.push(label + " was =" + oldValue + "; now =" + newValue);
}
});
$("#_fid_17").html(log.join("\n"));
});
I've done some basic debugging with alerts and the code runs through completely, but nothing appears in my [Log] field (which is ID 17 and is a multi-line text field).
$("#_fid_17").attr("readonly", "readonly");
var label, oldValue, newValue, log;
$("#_fid_6, #_fid_7, #_fid_8").on("change", function() {
log = [];
_.each([6, 7, 8], function(fid) {
oldValue = $("[name=_fid_oval_" + fid + "]").val();
newValue = $("#_fid_" + fid).val();
if (oldValue != newValue) {
label = $("label[for=_fid_" + fid + "]").text();
log.push(label + " was =" + oldValue + "; now =" + newValue);
}
});
$("#_fid_17").html(log.join("\n"));
});
I've done some basic debugging with alerts and the code runs through completely, but nothing appears in my [Log] field (which is ID 17 and is a multi-line text field).
- MarkShnier__You5 years ago
Qrew Legend
My suggestion is to go low code, not use the Image On Load Technique which is officially unsupported by Quickbase and could break any time. Are you trying to log changes to a field? There are low code techniques for that.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------- ChanceStorey5 years agoQrew MemberYes. I would like to just click on a record and see all the edits that have taken place after the record has been approved (Field_ID "Status" = Approved).
- MarkShnier__You5 years ago
Qrew Legend
In brief you would set up a child table for an Audit Log. hen have an Automation fire when the record is edited and certain fields change.
The Action Steps of the Automation will write to the Audit trail table the field name, the old value and the new value and the [Last Modified by].
That is also record many entries where the old value and the new value are the same if you are tracking several fields. So then have a nightly automation to delete the duplicates. Fell free to post back if you get stuck.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------