Discussions

Expand all | Collapse all

Logging edits to a record

Tara Tara08-25-2014 12:23

_anom Diebolt)09-30-2014 17:24

Archive User09-30-2014 17:26

Archive User09-30-2014 17:30

Archive User10-10-2014 17:07

  • 1.  Logging edits to a record

    Posted 06-27-2014 13:38

    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?



  • 2.  RE: Logging edits to a record

    Posted 06-27-2014 13:52
    Yes this is possible. An append or prepend text field (QuickBase calls this property "Log entries" now) accumulates a short log of changes to itself. However, when used in conjunction with the image onload technique you can gather those fields that have been changed along with the old and new values and stamp this information into the append or prepend text field. In other words, the append or prepend text field would never receive human keystrokes - rather the script injected into the page will monitor for changes to field values and assemble a string of text reporting these changes and automatically insert the generated text into the append or prepend text field. When the form is ultimately saved the append or prepend text field will be holding a miniature report of changes to all fields being logged and QuickBase will stamp the date/time and user using the native operation of the append or prepend field.. This may seem fantastic that you can do this but the edit form actually contains both the new values of the fields and the old values of the fields in hidden form elements.

    I will come up with an example shortly - I have to finish watching my morning cartoons now.


  • 3.  RE: Logging edits to a record

    Posted 02-14-2018 00:50
    I don't care about the stupid points. Asking a new question just helps focus someone tagging on a new question to an old post. But don't even bother since there is a demo I created that does this and I should have included it in my reply. I just have to find it ...

    hang on


  • 4.  RE: Logging edits to a record

    Posted 02-14-2018 00:52
    :D - sent you an email but all good how ever we go lol


  • 5.  RE: Logging edits to a record

    Posted 06-27-2014 13:53
    I know that there is a third party add on which does this.  It basically received the Notification emails when a record was changed and parses out the changes  and records them to a QuickBase database.


  • 6.  RE: Logging edits to a record

    Posted 06-27-2014 13:57
    That is a ridiculous solution. Why not retarget a spy satellite and then call the QuickBase API when the changes are beamed back to HQ. This feature can be directly implemented in a QuickBase form.


  • 7.  RE: Logging edits to a record

    Posted 06-27-2014 14:04
    Thanks. Curious about the image onload technique, will wait for the example.


  • 8.  RE: Logging edits to a record

    Posted 06-27-2014 15:14
    Here is your example:

    Come Mr Tally Man Tally Me Bananna
    https://haversineconsulting.quickbase.com/db/bi5q4vzj9



    Edit Record 1 and Log Everything Like the NSA Does
    https://haversineconsulting.quickbase.com/db/bi5q4vzmc?a=er&rid=1

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=305

    Notes:

    Back to watching cartoons ...


  • 9.  RE: Logging edits to a record

    Posted 08-10-2017 15:11
    Hey Dan, 

    First of all, Big Fan! Long time listener, first time caller:  

    Looks as though the "Edit Record 1 and Log Everything LIke The NSA Does" link no longer works.  I'm trying to implement this solution as well and I'm running into some issues and I'm thinking I may just not be seeing the whole picture.  Help?

    thnx - Sam Trachy


  • 10.  RE: Logging edits to a record

    Posted 07-09-2014 18:11
    kind of a newbie here... where is the code inserted? and how would you log entries for a database that has 350 fields (and growing). I could really use this as an audit trail for my records!!

    Great answer by the way!


  • 11.  RE: Logging edits to a record

    Posted 07-11-2014 13:14
    Hi  Dandiebolt,
    Thanks for providing such a wonderful information above and prompt response !!

    I checked out link provided by you https://haversineconsultingr.quickbase.com/db/bgm2m4g?a=dr&rid=305
    and found java script code for on change action which logs the old and new values of input field in log type field.

    In Home settings-->Pages--> I created test.js page and writen the similar code but its not working.
    Do i need to add any js or html library in order to execute the js code ??

    Please Dan provide your valuable suggestion to me so that i can execute that script properly.

    Thanks in advance !!!


  • 12.  RE: Logging edits to a record

    Posted 07-11-2014 13:24
    I am in conference mode and unlikely to be able to reply until next week.


  • 13.  RE: Logging edits to a record

    Posted 07-11-2014 13:57
    Thanks Dan ...not a problem .. Please take your time ..and i will be waiting for your response. :)


  • 14.  RE: Logging edits to a record

    Posted 07-16-2014 03:44
    Can you please explain how this is done step by step. Thanks


  • 15.  RE: Logging edits to a record

    Posted 07-16-2014 03:44
    Can you please explain how this is done step by step. Thanks


  • 16.  RE: Logging edits to a record

    Posted 07-16-2014 18:52
    You may also want to talk to Trinity Integrated Solutions (trinityis.com) about their Log Tracker; which would probably be more useful as a reporting tool.


  • 17.  RE: Logging edits to a record

    Posted 07-28-2014 07:26
    Hi Dan.. I hope you are doing good !!
    Could you please elaborate about the above script. and  how it will get trigger and what are the modifications required in order to use it in my application.

    Eagerly waiting for your response :)

    Regards,
    Rahul


  • 18.  RE: Logging edits to a record

    Posted 07-28-2014 12:13
    Hi, Dan! I'd like to +1 Rahul's request above. This is my first attempt with the image onload technique. I tried it several different ways over the weekend and was not able to get the log field to work at all. I've got to be missing something. If there's any way you could provide a step by step on how to use the image onload technique specifically to create this log field it would be greatly appreciated. I can think of numerous instances where having this log in my records would have been a great help! Thanks in advance for your help!


  • 19.  RE: Logging edits to a record

    Posted 07-28-2014 14:29
    The image onload technique is described at length in a step by step manner here:

    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=294


  • 20.  RE: Logging edits to a record

    Posted 07-28-2014 15:55
    Thanks, Dan! That is helpful and much more thorough then the instructional I found. I do have a couple of questions. When it says to create a user defined variable where do I do this at? Also, I see where I can add a page. It gives me three options...1. Home Page, 2. Rich Text Page, 3. HTML/Code Page. Is this the right way to create a user defined page or is that something entirely different? I have tried searching for more info on this but did not find an answer. I appreciate your help and apologize if this information already exists somewhere and I'm not seeing it.


  • 21.  RE: Logging edits to a record

    Posted 07-28-2014 16:02
    User defined variables are created from the Application Settings page (look for "Variables") and user defined pages are created from the same Applicaiton Settings page (look for "Pages" and select code page):

    https://<subdomain>.quickbase.com/db/<dbid>?a=AppSettingsHome

    Application variables act as text fields that can be used in a formula in *any* table in the application.


  • 22.  RE: Logging edits to a record

    Posted 07-28-2014 16:26
    Ok. Thanks! When I put the following code into my image onload field [-]:

    [iol] & "module.js & [/iol]

    I get the following error:

    Formula syntax error

    Expected a valid expression after the "&"

    [iol] & "module.js & [/iol]

    More on syntax errors...

    Any idea on what I'm doing wrong? Thanks for your help!


  • 23.  RE: Logging edits to a record

    Posted 07-28-2014 16:31
    you are missing the second double quote:

    [iol] & "module.js" & [/iol]


  • 24.  RE: Logging edits to a record

    Posted 07-28-2014 16:42
    Yes that was it. Thanks you! One more question. Does the script you provided for logging changes in the example above (https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=305) replace the generic image onload code (https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=293) or do they both have to be in the user defined page module.js?


  • 25.  RE: Logging edits to a record

    Posted 07-28-2014 16:54
    Yes - I typically just post the essential code that would go in module.js. You may have to make additional modifications depending on your specific needs. Note that this fragment of code does not contain the generic wrapper that decodes what page you are on and places all the code within a closure so that your JavaScript variables will not conflict with QuickBase's globals (they sure have a lot of globals!). See

    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=293


  • 26.  RE: Logging edits to a record

    Posted 07-28-2014 17:16
    Thanks! I'm not very knowledgeable in javascript so I apologize for my repeated questions. I still can't seem to get it to work. Below is the code that I have on my module.js page. If you could provide any guidance on where I'm going wrong I would greatly appreciate it!!!

    (function(){
      var querystring=document.location.search;

      if (/dlta=mog/i.test(querystring)) {

    $("#_fid_341").attr("readonly", "readonly");

    var label, oldValue, newValue, log;

    $("#_fid_339, #_fid_328, #_fid_203, #_fid_103, #_fid_318", #_fid_27, #_fid_170, #_fid_28).on("change", function() {

      log = [];
      _.each([339, 328, 203, 103, 318, 27,170, 28], 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_341").html(log.join("\n"));

    })();


  • 27.  RE: Logging edits to a record

    Posted 07-28-2014 17:26
    You are testing if you are on the grid edit page:

    if (/dlta=mog/i.test(querystring)) {

    when I think you intend to test if you are on an edit record page:

    if(/a=er/i.test(querystring)) {

    Note this logic is used in parallel with the form definition that sets whether or not the [-] field is included on the form in the first place. You may or may not need to include the if statement if you otherwise prevent the [-] field from being on the form/report.


  • 28.  RE: Logging edits to a record

    Posted 08-07-2014 21:57
    Hi Dan,

    I have implemented this code and it works great as far as tracking the edits but it's not showing the field label.  All i get in the log is    was =10:00 am; now =11am     without the label before the word "was".   Do you know what may be causing this?  The code I am using is below, thanks!:

    $("#_fid_122").attr("readonly", "readonly");

    var label, oldValue, newValue, log;

    $("#_fid_8, #_fid_9").on("change", function() {

      log = [];
      _.each([8, 9], 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_122").html(log.join("\n"));

    });


  • 29.  RE: Logging edits to a record

    Posted 08-07-2014 22:12
    View source and search for the strings "_fid_8" or "_fid_9" which should be in the page. Post the HTML fragment that you find which includes the <input> and associated <label> tags. If the label is coming back empty but evertyhing else works there is probably just a slight modification to the selector needed on this statement:

    label = $("label[for=_fid_" + fid + "]").text();

    Please note that this solution would not be possible without the generous support of the Image Onload Foundation.


  • 30.  RE: Logging edits to a record

    Posted 08-07-2014 22:23
    THanks, this is what I find for "_fid_8":

    <td id="tdl_19" class="label lc" >
    <label class="fieldLabel " for='_fid_8'><b ></b></label>

         <div id="tdf_19" class="cell cc nowrap" ><input name=_fid_oval_8 type=hidden value='10:00 am'>
         <input type=text size=16 name='_fid_8' id='_fid_8' onBlur='OnBF(this)' onFocus='OnFF(this)' value='10:00 am' >


  • 31.  RE: Logging edits to a record

    Posted 08-07-2014 22:33
    For some reason the HTML <label> generated by QuickBase for the label has no text. Since you only have two fids in your loop you could either remove the loop and inline all the statements or keep the loop and insert logic that will supply a hardcoded label value:

    //label = $("label[for=_fid_" + fid + "]").text();
    if (fid == 8) {
      label = "foo";
    } else if (label == 9) {
       label ="bar";
    } else {
       label = "missing!";
    }


  • 32.  RE: Logging edits to a record

    Posted 08-21-2014 20:48
    I want this to work so bad, but it's still not working for me. Here is a break down of what I"m doing. If anyone can help, I would REALLY appreciate it.

    1.) I created a new text page called module.js with the code below

    (function(){
      var querystring=document.location.search;

      if(/a=er/i.test(querystring)) {

    $("#_fid_341").attr("readonly", "readonly");

    var label, oldValue, newValue, log;

    $("#_fid_339, #_fid_328, #_fid_203, #_fid_103, #_fid_318", #_fid_27, #_fid_170, #_fid_28).on("change", function() {

      log = [];
      _.each([339, 328, 203, 103, 318, 27,170, 28], 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_341").html(log.join("\n"));

    });

    2.) I created two variables...

    The first variable is named "iol" and contains the following:

    <img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=

    The second variable is named "/iol" and contains the following:

    &rand='+new Date().getTime())};">

    3.) In my projects table, I have created a multi line text field called [Change Log]. The field id for this field is 341. Input type is "User Input". I have the box checked for "Allow some HTML tags to be inserted in the field". I have checked "Log the edits to this field, and show them on forms".

    4.) In my projects table I have created a formula text field called [-]. The field id for this field is 377. I have checked the box to allow some HTML. The formula for this field is below:

    [iol] & "module.js" & [/iol]


  • 33.  RE: Logging edits to a record

    Posted 08-21-2014 20:51
    I also should add that both the [Change Log] and [-] fields are on my form for the projects table. For the [-] field I have checked the box to use an alternate text label and inserted just a single space in the area where you are supposed to type the alternate text label.


  • 34.  RE: Logging edits to a record

    Posted 08-21-2014 22:29
    You are missing a set of parenthesis on the very last line of your code:

    })();


  • 35.  RE: Logging edits to a record

    Posted 08-21-2014 23:29
    Thank you! I added that, but it's still not logging edits to the records. Any other suggestions?


  • 36.  RE: Logging edits to a record

    Posted 08-22-2014 01:16
    You should just use straightforward debugging techniques. Put an alert("got this far") or console.log("got this far") in the code to insure you code is even running in the first place. Also expose the Console (press F12) to see if there are any JavaScript error messages.


  • 37.  RE: Logging edits to a record

    Posted 08-22-2014 02:37
    You have SEVERAL additional errors in your code - I apparently just reported the first one I saw. Corrected here:

    http://pastie.org/9493321

    You can minimize errors like this (everyone makes them including experienced developers) by using a variety of tools.

    JSBeautifier will format you code:
    JSBeautifier
    http://jsbeautifier.org/

    JSfiddle has a "linting" tool built into it which will identify syntax errors:

    JSfiddle with JSHint
    http://jsfiddle.net/rnp058hc/

    The text editor Notepad++ has syntax highlighting and matching brackets highlighting which will help you find unbalanced brackets:

    Notepad++
    http://notepad-plus-plus.org/
    There are thousands of similar tools available so pick those that you are comfortable with.


  • 38.  RE: Logging edits to a record

    Posted 08-22-2014 18:11
    Yay! I got it to work! There is only one problem...it doesn't log edits to look up fields. I have a field [Assigned To] that is a drop down pulling it's options from a users table. When I change who the record is assigned to it doesn't log that. It is logging edits to all of the fields that are not look up fields though. Any suggestions on how I can get it to log edits to the look up fields? Thank you so much for your help. I really appreciate it!


  • 39.  RE: Logging edits to a record

    Posted 08-22-2014 18:29
    Also, for some reason instead of each record edit being on it's own line, it's all running together like this...

    -- [AUG-22-14  2:17 PM  Tara Haack] --------------Other Main Contact was =Jen Feller; now =Tara Haack Status was =Not Started; now =In Progress


  • 40.  RE: Logging edits to a record

    Posted 08-22-2014 19:06
    I figured out the text running together issue and fixed it. It was because I had the box checked to allow some HTML for the text field that is the change log. I still have the issue with not being able to log edits to lookup fields though. Thanks!


  • 41.  RE: Logging edits to a record

    Posted 08-23-2014 21:21
    >I still have the issue with not being able to log edits to lookup fields though.
    A lookup field can only change when the [Related Parent] field changes. To get the old and new values of the lookup filed you have to perform two AJAX requests to the parent table using (1) values of the [Related Parent] stored in the hidden input associated with the [Related Parent] <input> as seen here for fid=7:
    <input name=_fid_oval_7 type=hidden value='1'>

    and (2) values of the [Related Parent] associated with the selected option of the [Related Parent] <select> as seen here for fid=7:
    <SELECT size=1 name='_fid_7' id='_fid_7' ...> <option value="" style="color:#888888;"> Make a Selection... </option> <option value="1" >Record #1 - foo - 123</option> <option value="2" selected>Record #2 - bar - 456</option> <option value="" style="color:gray;" disabled>--------</option> <option value="_other">&lt;Add a new record...&gt;</option> </SELECT>
    The value of the lookup field from the AJAX call in step (1) will be the old value, while the value lookup field from the AJAX call in step (2) will be the new value. Note that even if a new parent record is selected it may be the case that the lookup field does not change value even though the related parent record does change - you may or may not want to note such a situation in your log.


  • 42.  RE: Logging edits to a record

    Posted 08-25-2014 12:23
    Thank you! I will experiment with this.


  • 43.  RE: Logging edits to a record

    Posted 09-30-2014 16:37
    Hello, Dan!
    I have a little issue. The code works fine, but the test in the "Log" file automatically typing everything in one line. So, it is a little messy. In your example: https://haversineconsulting.quickbase.com/db/bi5q4vzmc?a=dr&r=b
    - everything is clear and readable. How did you make the data typing in a new line?
    Thank you!


  • 44.  RE: Logging edits to a record

    Posted 09-30-2014 16:46
    The array log is joined with a newline character to form a multiline string with the statement:

    $("#_fid_11").html(log.join("\n"));

    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=305


  • 45.  RE: Logging edits to a record

    Posted 09-30-2014 17:06
    Dan, may you check the code:
    (function(){
      var querystring=document.location.search;

      if(/a=er/i.test(querystring)) {

    $("#_fid_797").attr("readonly", "readonly");

    var label, oldValue, newValue, log;

    $("#_fid_242,#_fid_138").on("change", function() {

      log = [];
      _.each([242,138], 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_797").html(log.join("\n"));
          });
        }
    })();


    Thank you!


  • 46.  RE: Logging edits to a record

    Posted 09-30-2014 17:11
    Inconsistent indentation. Fixed here:

    http://pastie.org/9607867

    What is not working?


  • 47.  RE: Logging edits to a record

    Posted 09-30-2014 17:19
    Nop...Still typing in the same line...
    May be you did change the properties for the [Log] field?


  • 48.  RE: Logging edits to a record

    Posted 09-30-2014 17:24
    [Log] is a multi-line text field.


  • 49.  RE: Logging edits to a record

    Posted 09-30-2014 17:26
    You did it! Thank you!


  • 50.  RE: Logging edits to a record

    Posted 09-30-2014 17:28
    Celebrate - run through your office singing the Banana Boat Song. Here are the lyrics:

    http://www.azlyrics.com/lyrics/harrybelafonte/dayothebananaboatsong.html


  • 51.  RE: Logging edits to a record

    Posted 09-30-2014 17:30
    Thank you, Dan!
    Have a wonderful day too!


  • 52.  RE: Logging edits to a record

    Posted 10-10-2014 16:16
    Hello, Dan!
    Everything runs great! Only one problem: the [Log] field takes too much space, a lot of changes in the Project. Than more changes then more longer field. The question is how to organize it?
    The ideal would be to see only a few latest changes and other just hide, something similar to messages like 1,2,3 pages... Or may be to create a separate table for tracking...
    Thank you!


  • 53.  RE: Logging edits to a record

    Posted 10-10-2014 16:42
    > ...more changes then more longer field.

    But this is the natural result of logging all the changes - it is going to take up more space if there are numerous changes. Beyond the general idea of using script to log changes to fields, you could track just the last n changes or perhaps just the changes made during the last 30 days. And where you store the changes is another dimension you can explore.

    Also I should mention that the code I provided works for simple text and numeric fields. If you start logging checkboxes or lookup fields additional logic is needed. Date fields create another complexity. Date fields changed by direct user input  trigger a change event but dates entered through the popup calendar are made through JavaScript an do not generate a change event (you have to use periodic polling to detect date changes). These issues have come up (and have been solved) with some clients exploring other logging scenarios. This is the type of solution which will evolve as users try it out.


  • 54.  RE: Logging edits to a record

    Posted 10-10-2014 16:55
    Ok. That's interesting to store date just n-days. Would you please clarify how to do it.
    For example, it would be meaningful to store the changes for 7 days.


  • 55.  RE: Logging edits to a record

    Posted 10-10-2014 17:05
    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.


  • 56.  RE: Logging edits to a record

    Posted 10-10-2014 17:07
    Thank you!


  • 57.  RE: Logging edits to a record

    Posted 10-10-2014 17:53
    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 [Tracks] to 'Display just link' and open in a new window.
    Now, everything work ideal: a little link on the button of each project called [Tracking], plus now I have options which project I'd like to track!
    Thank you and have a wonderful day!


  • 58.  RE: Logging edits to a record

    Posted 10-10-2014 18:44
    I have already started to celebrate your solution! Happy Weekend!


  • 59.  RE: Logging edits to a record

    Posted 10-10-2014 22:18
    Good joke! :smile: )) You too have a nice weekend!
    And thanks for the great help in the community!


  • 60.  RE: Logging edits to a record

    Posted 04-08-2015 16:33
    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.


  • 61.  RE: Logging edits to a record

    Posted 11-06-2017 14:49
    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


  • 62.  RE: Logging edits to a record

    Posted 11-06-2017 15:00
    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.


  • 63.  RE: Logging edits to a record

    Posted 11-06-2017 15:03
    $("#_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"));

    });


  • 64.  RE: Logging edits to a record