Forum Discussion

KrishnaKrishna's avatar
KrishnaKrishna
Qrew Trainee
11 years ago

Logging edits to a record

Is it possible to set up a multi line text field that can log every edit made to a record with the field that was touched, user who did it and a date stamp?

76 Replies

  • My original example used a text multiline field with logging turned on so the user and timestamping was created by QuickBase automatically - the script just gather the old and new values of those fields that changed and stuffed them into the logging field. To log just the last n changes or changes over the last 7 days you would have to use a text multiline field without logging turned on and (1) perform all the  user and timestamping yourself in addition to (2) removing "old" changes that become stale and (3) adding "new" changes. It is just more script to write to suit the specific needs of your logging strategy. If you need help contact me off-world using the info in my profile.
  • Dan, I've solved this problem.
    1)I created a new table /Tracking/, connect this table with /Projects/.
    Each Project has many Tracking. Now /Project/ consists: 'Track'-report link and 'Add Track'. /Tracking/ consists: Related project and Text(lookup) Project-Log.
    2)Next step, I went to "Change the properties" field [Log]  and simply changed "Display when this is used for:" edit. My aim was: do not see the tracking in project in view.
    3)I changed the field to 'Display just link' and open in a new window.
    Now, everything work ideal: a little link on the button of each project called , plus now I have options which project I'd like to track!
    Thank you and have a wonderful day!
  • Good joke! :smile: )) You too have a nice weekend!
    And thanks for the great help in the community!
  • Hi Dan, I successfully set this up in my table.  The only issue I have is that when it logs the changes, the names of the fields are logged as they appear in my form; that is, the title of the field in my log is the form alias.  This is problematic for me as we have a matrix of fields set up, and the aliases are all empty text.  Is there a way to have the log use the actual field names instead of the form alias'?

    Hope that was a clear explanation of my problem.  And as a side note, Thanks for all your continued contributions to the community.  You have solved so many of my QB issues with your posts.  Thank you.
  • AlinMihalcea1's avatar
    AlinMihalcea1
    Qrew Assistant Captain
    Dan, I am employing your solution ,but I have a question for you regarding the logging of check boxes. Below is an example of how the code is logging currently. 
    Can I have it say "Was = Off; now = On" ?
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    [NOV-06-17  8:39 AM  XXX] ROM Confirmed Completion was =1; now =on
    Ready To Invoice - Notify AR was =0; now =on
    In AR Review was =0; now =on
    Rejected By AR was =0; now =on
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      Sure this would be possible and would probably be trivial. But you would have to point me to my own example as I have so many it can become difficult to locate them without having a link or an obvious search strategy to find it.
    • AlinMihalcea1's avatar
      AlinMihalcea1
      Qrew Assistant Captain
      $("#_fid_342").attr("readonly", "readonly");

      var label, oldValue, newValue, log;

      $("#_fid_243, #_fid_235, #_fid_237, #_fid_251, #_fid_239, #_fid_241, #_fid_259, #_fid_132").on("change", function() {

        log = [];
        _.each([243, 235, 147, 237, 251, 239, 259, 132], 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_342").html(log.join("\n"));

      });
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      Change oldValue => (oldValue ? "on" : "off") as follows:

            log.push(label + " was =" + (oldValue ? "on" : "off") + "; now =" + newValue);
  • YehudahGreenber's avatar
    YehudahGreenber
    Qrew Assistant Captain
    Hi Dan, I've seen many of your posts dealing with IOL, but I haven't taken the leap to try it until now- The directions are simple enough, and it works great, thank you!
    I am having a bit of an issue logging changes to a "user" field; changes to my user field don't show up in the text field that logs all the other changes.  Is there a way around this?
    I have also notices that changes to multiple choice "radio" buttons don't log; changes to these fields only log when they are pull-down menus.
  • 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).
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew 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
      ------------------------------
      • ChanceStorey's avatar
        ChanceStorey
        Qrew Member
        Yes. 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).