Jump to content
Sign in to follow this  
domb

Field history

Recommended Posts

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 by Guest

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Thanks for your answer, but "committing the record" in the script doesn't work either.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks very much for your 2 solutions.

I like the first one and will use it !

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.