Jump to content
Server Maintenance This Week. ×

Record Modification Timestamp


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

Recommended Posts

Hi. I’m new here. I just started using FMP 8.

I have a script to cancel changes made to a record.

If the user just enters the record and makes no changes I want it to exit without any dialog.

If the user makes changes I run Revert Changes but only after confirmation.

So I’m comparing the entry time to the current record to the record modification timestamp. The problem I have is the modification timestamp appears to only update when the record is committed. And once the record is committed I can’t revert changes. Is there a different way to check if the record was modified that doesn’t require the record being committed, without having to look at each field in the layout?

Link to comment
Share on other sites

So you want the mod timestamp to change even if your user cancels changes? Just attach to your cancel script one extra step that says:

SetField [ Yourtimestampfieldhere ; Get(CurrentTimestamp) ]

If thats not what you wanted post back.

~Genx

Link to comment
Share on other sites

Genx,

Thank you for responding. My Timestamp field is set to update to the current timestamp when a change to the record is made. The problem I’m having is right now the Modification timestamp changes but only when I commit the record. I need it to change before I commit the record because I use that field to see if the record was changed. Or I need another way to test if the record was changed before it is committed.

Thanks

Link to comment
Share on other sites

I'd try and answer your question, but i'm still a bit confused at this point. Could you dumb down what your trying to do just a little bit more. I'd try and provide a solution, but if i don't know the real problem it won't be much help. If someone else understands this, they could try field it i suppose.

~Genx

Link to comment
Share on other sites

Basically, you want an timestamp to change as soon as anything in the record is chaned?

Well, if you use the evaluate function, it can change as soon as they leave the field they just modified.

Make your timestamp field and Auto Enter timestamp and then make this for the value: (make sure "Do not replace existing value" is unchecked.)


Evaluate(Quote(Get(CurrentTimestamp)); [field1; field2; field3; field4; field5])

Where the fields are every field in your record that could possibly be changed by the user.

Link to comment
Share on other sites

Thank you both.

I'm sorry I was not clear, I was trying to be ;)

Yes I want the timestamp to change as soon as anything in the record is changed.

I was hoping for a solution that can overall check if the record was modified without having to list all the fields that can be modified (without commiting the record).

If that is not possible then I'll do the field listing solution.

Thank you very much.

Link to comment
Share on other sites

If the record was truly modified (i.e. committed), you cannot revert the changes.

If the record was not yet committed, the modification stamp has not changed.

I think you may want to use the Get(RecordOpenState) function - but I am not entirely sure what exactly do you intend to accomplish here.

Link to comment
Share on other sites

I would use the record modification count if possible (see the Get() functions). Check its value upon entry to the record, and then again when exiting. If the modification count hasn't changed, then the record wasn't modified.

Edited by Guest
Link to comment
Share on other sites

Thanks again for all the solutions.

Unfortunatly, Get(RecordModificationCount)

works only if the record is commited, I want before comitted.

The Evaluate does work, I was hoping for something that did not require listing all the fields. But so far everything else I have tried you need to commit the record first. So they will not work for me.

Thanks again to everyone for the suggestions.

I'm sure after I set everything with evaluate another perfect idea will pop up. :D

Thanks!

Link to comment
Share on other sites

Have you tried Get(RecordOpenState) function?

Thank you so much for reposting this. It was late last time I looked at it and misread it. You are right. This is exactly what I was looking for. I knew I was missing something. (I just did not know what....)

Thank you so very very much.

Link to comment
Share on other sites

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