Jump to content

This topic is 8354 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

I would like to know if there is a way to track the field changes made.

For example you can track the record by creating a creation date and modification date.

Can you track and do the same thing to a field instead of record?

Posted

Hi Convz,

There are a couple of different ways of doing this.

The simplest is to define a new *stored* calculation field for each information you would like to store about a changed field (e.g. time or date).

For example, if you want to track the time someone last changed field A, the calculation field would be defined like this:

If(A,Status(CurrentTime),Status(CurrentTime))

If you also wanted to track the date then you would add another field looking like this:

If(A,Status(CurrentDate,Status(CurrentDate))

...and add more calculation fields (e.g. CurrentUserName) until you are happy.

This works fine in most cases, but it isn't very stable. If your solution crashes and you have to perform a recovery of your data, the calculation fields might loose their content (or be recalculated, which makes the data in them faulty!).

Then there is another, a bit more complex solution, which stores the data in lookup fields, which in turn relies on relationships that has to be defined. It's too long for me to describe here, but there's a downloadable database with an example of this on www.databasepros.com. Go to the "Resources" section and search for "Field modification". You might get several hits. The one I mean is called "Field modification" (*not* the one with 5 at the end) and it is a FileMaker 3/4 database (but it works in FMP 5 after convering).

Hope this helps,

Daniel

Posted

Ok! I can only think of one way of doing this........ But there my be more. This method requires 2 new fields and a self-relationship. The problem is, however, that you need to create a new relationship for each field you want to track.

Lets call the field you want to track PRICE

Now create a self-relationship PRICE::PRICE

Now create a calculating field CURRENTDATE= Status( CurrentDate)

Remember to turn the indexing off for this or it won’t update correctly

OK, now create the date field TRACKPRICE

This field is a normal date field, set to a lookup based on the relationship PRICE. It should look up the field CURRENTDATE. However, if you were to leave it at this you would notice that it doesn’t work – now for the trick. In the look-up options you need to select:

“If no exact match, then: copy next lower value.”

Now you will see that changing PRICE will force TRACKPRICE to update to the current date. Copying the next lower value is not important, as the current date is the same for all records across the DB.

Hope this helps,

Rigsby

If anyone has a better way of doing this, please let me know

This topic is 8354 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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