UpdateValueWhenNotDisabled ( currentValue ; newValue )
In an Auto-enter Calculation: updates the field value to newValue if $$DISABLE_UPDATE_VALUE is False. If $$DISABLE_UPDATE_VALUE is set to True, the field retains currentValue.
Be the first to rate this function Log in to vote
Dale Long - Show more from this author |
Let ( ~trigger = GetField ( "" ) ; UpdateValue ( Self ; Get ( AccountName ) )
User with account name "Jill" edits and commits the record.
$$DISABLE_UPDATE_VALUE = False ; "Jill"
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
I've run into problems with doing extensive refactoring an old database. This often requires transforming data in existing fields or seeding data in a new field. Modification timestamps, modification accounts, etc. get updated during these processes, which gets rid of 'real-world' data. Who was the last person to modify this record in actual use? And when did that happen?
I've reconfigured the modification_account and modification_timestamp fields in this database to use an auto-enter calculation rather than using the 'Creation' or 'Modification' checkboxes in the field options. This CF is used in those auto-enter calculations ('Do not replace existing value of field' is unchecked, so that the field can respond to record updates).
you can toggle $$DISABLE_UPDATE_VALUE to True in a script or other Let statement in order to suppress any updates to that field. Once any transforms or data seeding is complete, Toggle $$DISABLE_UPDATE_VALUE back to False or "", and auto-enter updates will resume normally.
**edit - made CF name more verbose to clearly identify its function. Changed from UpdateValue to UpdateValueWhenNotDisabled
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.