Forum Discussion
76 Replies
Sort By
- TaraTaraQrew MemberThank you! I added that, but it's still not logging edits to the records. Any other suggestions?
- _anomDiebolt_Qrew EliteYou 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.
- _anomDiebolt_Qrew EliteYou 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. - TaraTaraQrew MemberYay! 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!
- TaraTaraQrew MemberAlso, 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 - TaraTaraQrew MemberI 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!
- _anomDiebolt_Qrew Elite>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"><Add a new record...></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. - TaraTaraQrew MemberThank you! I will experiment with this.
- ArchiveUserQrew CaptainHello, 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! - _anomDiebolt_Qrew EliteThe 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