Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I am fascinated by FileMaker by now, a bit addicted, I guess; and I want to learn more.

I can create a script to enter the username in a field to log who is changing what in a DB.

Is there a way FM can sense a change in the modification date so that the script I have is automatically triggered?

Posted

Look in the sample files fourm for an amazing demo of an audit log. I think Bob Weaver put it together. No scripts required.

Posted

I checked out the download for the audit trail and I realize that its pretty amazing and pretty complex at least because it works for many fields on the layout.

My needs are simpler with only two fields to contend with; ie. I would like to insert the user name in a field when the modification date changes -- I suppose I could work on boiling it down but if there was a simple version I would really appreciate it ..... thanks:)

Posted

Are you wanting to track what the user has changed or just that a change has been made? I assume you are wanting a return-separated list of usernames in the field. Is that correct?

Posted

I have a layout with a creation date field and an user name field (that gets auto-entered when a new record is created.

I have a modification date field that tracks when data has changed -- I would like to have the username of the user who changed the data to be entered in a field accordingly.

I was looking for a script to be triggered by the change in the modification date to accomplish that.

Other means are welcome .....:

Posted

Well it's just one of those nights ... I've posted and deleted twice because I forget what I'm doing and I'm unsure if I'm even answering the correct question. :blush2:

Anyway, I feel momentarily coherent, so here's my response. Now I'm stopping because obviously I need a break. :giggle: :

Auto-Enter (Replace) can do this, geoffrey. You don't need script or plugin. One of the beauties of vs. 7/8 is [color:red]the ability for a field to reference itself!! We just need to know what you want for the result. It might be useless to have a multiline with all the Users who have modified a specific field ... if one doesn't also capture the ModificationDate or Stamp along with it (in same multiline). If only one entry - the LAST person who modified the specified field (date/time already captured in ModifyStamp field), then that is easy also. You want to sense a change according to Modification Date? What if two Users change the record or field on the same day? Do you want to know that? If so, pull a stamp field (which combines date & time) into the field along with UserName.

Field you want to track: textField. New standard text field called textModifiedBy - set to Auto-Enter (Replace) with:

If( textField ; Get(AccountName) & ¶ & textModifiedBy ; Get(AccountName) & ¶ & textModifiedBy )

"What? How can that work - telling it to evaluate regardless?" you ask? [color:red]The new text field won't evaluate unless the original textField changes!!!! That's exactly what you want, right? Pretty, huh? There are many variations depending upon what you want (and you can even have it ignore adding a User if it's the same User who modified it last - or modified it several times in one day). So you can pull in your Modification date if you wish but it isn't needed. Give us exactly the result you require, as -Queue- mentioned. We can produce the correct result in one field as multiline (date/time/user ... whatever). Oh. On above, uncheck 'Do Not Evaluate If All Referenced Fields are Empty'. BTW, this sentence bugs me ... the truth is 'Do Not Evaluate If ANY fields are empty' and FM should correct their mis-statement. It can make a big difference in understanding if taken literally.

LaRetta

Posted (edited)

I have a modification date field that tracks when data has changed -- I would like to have the username of the user who changed the data to be entered in a field accordingly.

Seems to me that is a clear statement of the desired result.

I would change the modification_date field from date to timestamp (EDIT: not really required - it will work with date, too), and add a text field with auto-enter (replace) =

Let ( trigger = modification_date ; Get (AccountName) )

Edited by Guest
Posted

LaRetta! You are beautiful:)

I don't need a multiline with all the Users who have modified a specific field.

Its really simple. I have four fields: "creation_date", "created by", "modification_date" and "modified by".

"creation_date" is auto enter as is "modification_date" - I just want that when a new record is created, the username is inserted in "created by"; and, when the record is modified, the username associated with who did the modification will be inserted in "modified by".

That simple: no lists, no timestamps, no logs, no other tables, etc. It will not matter, for example, if two users change the db on the same day, etc.; I just need the LAST person to mod it.

If it is an Auto-Enter (replace), can you give an example ...?

Posted

But Michael, won't that trigger the change when ANY change is made to ANY field in the record? I thought the desired result was only if ONE field changed, ie, tracking THAT field's history only.

I've no doubt I misunderstood; either the original question or your answer or both. :wink2:

L

Posted (edited)

Are you aware that there is an Auto-Enter Modified By also; in addition to Modification Date and TimeStamp?

Update: Oh that's too funny!!! The first post I made (then deleted) then posted again and forgot and deleted - was this very sentence!!! ROFLMAO!!

That's it! I'm outta here!! :jester:

Edited by Guest
Posted (edited)

to enter the username in a field to log who is changing what in a DB

This threw us - WHO IS CHANGING WHAT! I thought he wanted field-specific also!! But when he said he wanted the ModifiedBy to 'fill in', I posted with Auto-Enter answer 'Modification UserName'. :blush2:

Then I posted using ModificationStamp to trigger!!! HA HA!!! Deleted them; couldn't figure out what he wanted, then 'overkilled' the issue!

And I realize I'm sitting here STILL with no clear idea what is needed!! :giggle:

Night night

Edited by Guest
Posted

Amazing!

I need: to track when ANY change is made to ANY field in the record (except for those four specified fields, of course) by date (modification_date) and by whom (modified_by) .... that's all:)

I don't know how to do this apparently simple thing: to update "modified_by".

Posted

You know how you created your CreationDate field? By selecting it's Auto-Enter tab and, at the top clicking the radio for 'Creatioin Date'?

Pop open that box. There is more than Creation Date in it ... there is also Account Name and Name and TimeStamp. Also true for Modification.

I always create the four fields (all same Auto-Enter selections at top):

CreateStamp, CreatedBy, ModifyStamp and ModifiedBy

FM does it all for us. :wink2:

This topic is 6957 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.