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__You
Qrew Legend
5 years agoMy 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
------------------------------
------------------------------
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
------------------------------- DanielJohnson24 years agoQrew TraineeHey Mark,
I inherited an app that had an Audit Log table that was using webhooks to log changes. It wasn't entirely clean. I modified it to log the changes to a record using Pipelines. However, the form view also had a "Milestone" section that had summary fields from the Audit Log table that showed the progress of each record in a section inside its form view. I made new fields in the Audit Log for the Pipelines and when I was about to make the new summary fields, I thought, why not just make a new field in the original table and make a Pipeline that updates that record when changes are made? It seems to be working for our standard case. Can you think of a reason why this wouldn't work? Are there any pros and cons in logging the changes in the original table using Pipelines versus logging the changes in a child table using Pipelines?
Curious for your thoughts.
Thanks,
Daniel
------------------------------
Daniel Johnson
------------------------------