domb Posted July 23, 2007 Posted July 23, 2007 (edited) Hello, I wish to make a field history i.e. a log entry each time I modify a field. To do that I added 2 excellent custom functions by NightWing Enterprises (SuperLog and ScriptLog) to my solution: http://www.nightwing.com.au/FileMaker/demos8/demo809.html It is exactly what I need and works quite well. The only problem is that to make a log entry after the field was modified, the user has to go MANUALLY to the next field. See example1.fp7 If the field is modified and then the user clicks on the "history" button without going first to the next field, no log entry is done. (Adding "going to next field" function or similar to the "Open Field History" script doesn't work). I solved this problem by using the second custom function (ScriptLog) which permits to trigger a log entry from a script. See example2.fp7 The problem that I have left, is that now, each time I click on "history" there is a log entry even if I didn't modify the field... How can I modify the custom function so that it makes a log entry only if the field was modified ? Thanks in advance for your help. examples.zip Edited July 24, 2007 by Guest
comment Posted July 23, 2007 Posted July 23, 2007 The only problem is that to make a log entry after the field was modified, the user has to go MANUALLY to the next field. I believe you are mistaken about that. To make a log entry, the user must commit the record. If you click the "history" button without committing the record first, you see no entry in the log - because the record was NOT yet modified.
domb Posted July 23, 2007 Author Posted July 23, 2007 Thanks for your answer, but "committing the record" in the script doesn't work either.
comment Posted July 24, 2007 Posted July 24, 2007 True, but that's another matter: the custom function you are using is purposefully designed not to modify the log when a script is running.
domb Posted July 24, 2007 Author Posted July 24, 2007 The "ScriptLog" function can be used from a script. See example2 file. The only problem is that it makes an entry each time I press the "history" button. I wish to modify the custom function so that it makes a log entry only if the field was modified.
comment Posted July 24, 2007 Posted July 24, 2007 I wouldn't mess with Ray's functions. Here are two alternatives you could try, but I haven't tested them thoroughly, esp. the second one, so proceed at your own risk. The best way, I think, would be not to have that button on the layout (or any other means for the user to get out of modifying data other than by committing the record properly). Or employ a simpler audit log method. example3.fp7.zip
domb Posted July 24, 2007 Author Posted July 24, 2007 Thanks very much for your 2 solutions. I like the first one and will use it !
Agnes Riley Posted October 5, 2007 Posted October 5, 2007 Hello, I am trying to get the Super Log System to work. Looked at your example file and the original, and they both work; mine doesn't. I get one line of the change, not the history and also, there's a second line with junk in it. Example: 10/5/2007 1:01:37 PM Admin Articles [---] -» werererrererkjbjkn werererrererkjbjkn I copied both custom functions from the original file and they seem to match line by line. There is a line in teh custom function "Get (ScriptName)"; I don't know what that refers to since we're not using a script here, right? Do you have any idea what's going on? Thanks, Ago
Recommended Posts
This topic is 6259 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now