April 2, 200619 yr 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?
April 3, 200619 yr 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
April 3, 200619 yr Author 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
April 3, 200619 yr 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
April 3, 200619 yr 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.
April 3, 200619 yr Author 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.
April 4, 200619 yr 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.
April 5, 200619 yr 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 April 5, 200619 yr by Guest
April 7, 200619 yr Author 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. Thanks!
April 7, 200619 yr Have you tried Get(RecordOpenState) function? I am still unclear regarding your purpose. After all, if the layout is set not to save changes automatically, Filemaker will pop the confirmation dialog for you.
April 7, 200619 yr Author 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.
Create an account or sign in to comment