2 Replies Latest reply on Oct 6, 2010 1:54 PM by jonasg

    get field value before and after change

    jonasg

      Title

      get field value before and after change

      Post

      Hi,

      I'm using FM11. In case a value in a certain field is changed, I need to run different scripts. Should I use Field Validation or a script trigger? Either way, I need to find out if the field has been modified at all. How do I get the field's value before it was edited?

      Thanks for your help!

        • 1. Re: get field value before and after change
          LaRetta_1

          Field-level validation won't work because FM cann't grab field value when entering a field.  Since you mention triggers, I assume you are using vs. 11.  You can use script trigger OnObjectEnter (but  OnObjectEnter will not work on radio button, checkbox or pop-up menu, which I consider a bug).

          Script might be simply called "Grab Field Value" and be:  Set Variable [ $$value ; Get ( ScriptParameter ) ] and the script parameter could be:  Get ( ActiveFieldContents ).  In this way, it could be used attached to many different fields.

          There are other approaches and ways around the issue for pop-up menus etc if you need to handle those.

          • 2. Re: get field value before and after change
            jonasg
            Thanks, LaRetta. That worked. I was hoping to find an "elegant" solution to this (to me, a trigger called onValidate sounds like it could provide script-side access to before-and-after data). Oh well, I feel like that kind of thing just happens all the time in FM if you have a background in "real" programming...