February 26, 201312 yr hello everybody I am pretty sure, that I've read about a technique that allows me to do the following, but I cannot figure it out. 1. I have a field with the value "a" in it. This field has a OnObjectSave trigger. 2. Now I change the value to "b" and the trigger fires. While the linked script behind the trigger is running, I am sure I read somewhere that I should be able to retrieve the old value "a" through a relationship somehow. So...is it possible to retrieve an old value BEFORE a record is commited ? Anyone any ideas:) ?
February 26, 201312 yr Author ahh sorry.. I removed the post. but yes. If you use a field and apply a popup valuelist or calendar to it, you can catch the prior value. if you need an example. i can show you. It works with the OnModifyObject trigger.
February 26, 201312 yr Could you post a demo file? Why would you apply a calendar to a non-date field in order to "capture" the original value prior to an edit?
February 28, 201312 yr Author Nobody refers to my first post Plz help guys @bcooney http://www.databuzz.com.au/filemaker-pro-v10-script-triggers-and-pop-up-menusdrop-down-lists/
February 28, 201312 yr The blog post simply tells you to pass the original value as a scriptparameter which is exactly what I said. It has nothing to do with how the field is formatted and certainly doesn't suggest using a calendar for a non-date field.
February 28, 201312 yr I am confused here ... there are a few ways to capture the prior value from a field using script parameter (as Barbara mentioned). You can even using OnObjectEnter (with pop-up) to use script parameter to set a global variable from the prior value (although script fires AFTER the value changes). So the type of field CAN make a difference in how you might wish to configure it. You also need to consider whether you have layout setup checked 'save changes automatically' - they all work together to provide a good solution but we do not yet know the problem. The issue I see with the technique referenced is that it changes the modification timestamp on the record and the value didn't actually change and accurate modification timestamps are important. I would rather use Revert Record/Request[] instead of their script's 'Set Field[] and then Commit'. Electric Soul, there are two distinct issues here: Capture prior value: You can capture prior value before commit but the best method would be determined on a) layout setup of 'save changes', b ) field control type (whether edit, pop-up etc), 3) the purpose of your OnObjectSave script. Display of prior value: You can display the prior value on your layout using either a merge variable or a self-join relationship (and placing the self-join's same-field on the layout). Again, the best method would depend upon all of the factors mentioned. More information is need. And yes, I read your opening post and so did Barbara and Lee. If you provide a simple demo of your question, we can provide a specific, good solution; in fact I started a sample file but I do not have enough information to complete it. Edited February 28, 201312 yr by LaRetta
March 1, 201312 yr Author Hey @Everybody I am sorry for the confusion. I need to chose my words more wisely I am looking for a method that allows me to retrieve a previous value from a field WHILE editing(by hand or script) and BEFORE commit a record. So all methods, except post 6, that retrieve a previous value before I even start typing/running a script do not come into play. I was pretty sure, that I've read about a method that would allow this using relationships.
March 1, 201312 yr Have you tried what is being suggested? So even if everything we say fails what is wrong with post 6? Again, it is not clear for me what you want, sorry.
March 4, 201312 yr Author @LaRetta I am using 6, but I was hoping for slightly better way. I am looking for a method that doesn't involve to much "playing around". In my opinion Filemaker is too much about playing around and finding workarounds. In this case, if a record is not commited yet, then I think it should be possible to retrieve the current value somehow. PLUS, ....I am sorry, I skipped your suggestion. So I can see the prior value through a self-join if it's on the same layout. But this seems to apply only to my eyes right? Using a script, I always get the currently typed and not commited value. Is there a way to make a script see those prior values?
March 5, 201312 yr To get the prior value you'll need to "remember" it somehow BEFORE it is edited. FileMaker is not playing around. It is simple but logical. Try this yourself: 1) Pick something up with your hand. 2) Drop it and pick something else up. 3) Tell me what was previously in your hand. You cannot tell what was in your hand unless you had a process that remembered what was there before changing it. FileMaker can only tell you what is in the field NOW not what used to be in there. 1) Pick something up with your hand. 2) Remember what is in your hand. 3) Drop it and pick something else up. 4) Tell me what was previously in your hand by accessing the remembered value. You can now tell me what was there before because you explicitly remembered it. FileMaker it is a development environment and YOU are the developer. If you want something to happen then you need to make it happen.
March 6, 201312 yr Is this what you are trying to do? http://www.soliantconsulting.com/blog/2012/08/easy-filemaker-modal-edit-dialogs-full-rollback-support Brian
March 6, 201312 yr Author nope, but I am glad Filemaker supports transaction. I am only looking for what is described in my first post. i am not looking for other ways to achieve my goal. I only had a vague memory of such a method. And I think LeRetta helped me out here. LaRetta(Post #8) came close with his second suggestion, but unfortunately the prior value can only be seen with the eye, but not with a script
March 6, 201312 yr You miss the point ... You CAN see the value via script before changing it. You have not provided a specific example file. If you do, we will show you how. :-)
March 6, 201312 yr LaRetta(Post #8) came close with his second suggestion LaReta isn't a he, although one could be misled by the Pink Yoda icon. LOL
March 7, 201312 yr Author @LaRetta Oki... "her" ...np Example file? Well.... this would be a database with a single field and single record Scenario: Somebody is editing this field. The record is open, not commited. Now I run a script by picking it from the top script menu. I want this script to retrieve the previous value from this open record.
March 7, 201312 yr Okay, we are moving forward now ... why do you want the prior value - what is the User experiencing? I do not ask to snoop; only to understand the work flow. BTW, I am NOT in any way related to Yoda - my mamma swears she never even met the man so ... I am a cat ... clearly. ADDED: Also, what is the data type of the field and is there a control attached (pop-up, radio button etc)?
March 7, 201312 yr Author Well I am building something, but my question is pure interest. I was simply wondering, if I can avoid the hassle with catching pervious values in variables and such. I am simply here to learn if there is such a techique
Create an account or sign in to comment