"Trying to obtain information as to what record, field, and value was last set."
Meaning last modified?
A Date field can be set to "Auto-entered, Modified Date" in Field Options.
This will allow you to view and sort the Modified Date (and or Modified Time) for the Record, not the fields.
Audit Trails are difficult to create, some plug-ins offer simple versions, none of the free plug-ins I know of.
when I use Evaluate( Get ( ActiveFieldName );[ etc., I also get the value in the field
Well that's what evaluate is supposed to do. If you pass it a field name, it evaluates it--returning a value.
Remove the evaluate functions and just use the Get functions to extract the active field name.
Just using Get (ActiveFieldName) won't work. I need Evaluate to act as a trigger
when any one of several fields are changed. However, "Evaluate" causes the
value of the just-changed field and not the name of the just-changed field to be
entered into the "FieldName" field.
I could use a script trigger for everyone of the several variables and have them
put their field name into the "FieldName" field. The "FieldName" field contains
the name of the most recent field that had it's value changed.
But do you need to use evaluate in this specific script step? Can't use use evaluate in one step to "trigger" your updates and not use Evaluate in the step where you need the table occurrence and field names of the currently active field?
Can you describe exactly what triggers you need to trip with that evaluate function?
If you really want to do it all in one step, you might do this:
Let ( [ FieldRef = Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) ;
Dummy = Evaluate ( FieldRef ) // this should produce the same result in terms of "triggering" auto enter calcs--my guess as to what you mean
Tried the code from PhilModJunk but no results. Tried both "calculated field" and "text field with calculation".
Can't get the Get (ActiveFieldName) function to work under any circumstances.
I Created a test Field call FieldChanged. I have another field ProductCode I also created a script "Get Field Name" with the Following line.
I then set a script trigger (OnObjectModify) on the ProductCode to run the above script "Get Field Name".
This return the "Products::ProctCode" into the field FieldChange
Check to make sure that the field is really active.
The cursor must be in the field at the time that the script step with the get ( active... function executes or it is not the "active" field.
S Chamblee has a solution. I wrote my own code and it works. It's too bad
that I have to specify a trigger script for 32 different fields instead of getting
the changed-field to pick up the name of the field that was changed. I just
couldn't get Get (ActiveFieldName) to work inside of a field calculation. However
it does work in a stand-alone script (program) and that is what I will use as
my trigger script for all the 32 different fields.
One script should work for all 32 fields. If your are setting up the field as a button so that clicking it performs your script, that explains why get ( ActiveFieldName ) doesn't work. Clicking such an object never makes it "active". The cursor must be in the field for it to be active and the button setup prevents that from happening.
You still do not need 32 different scripts, however. you can use GetFIeldName as a script parameter passed to your script and specify a different field name with each use of this script in the optional script parameter box.
Then Get ( ScriptParameter ) will return the table::field text.
See this demo file: https://dl.dropbox.com/u/78737945/IndirectFieldRefDemo.fp7
Field 1 and Field 2 are set up as buttons performing the same script.
Field 3 uses the OnObjectEnter script trigger and the Get ( ActiveFieldtableName ) & "::" & Get ( ActiveFieldName )
Both scripts set this text in the field just to enter a value for demo purposes.
I private message from countryBoy indicates that he is using the OnObjectSave trigger.
The OnObjectSave Trigger is tripped after the field is exited so thus, the focus, as I had suggested is no longer in the field.
I have thus updated the demo file to show two ways to get this to work when using the OnObjectSave trigger. The same download link works so you can simply download the demo file a second time to get a copy with these updates.
true, but why get so complicated?
get (activeFieldName )
Returns the name of the field without using evaluate.