Reputation: 2873
I have a table that has auto-calculated fields for who (name) and when (date) the row was last changed, using the normal FileMaker field definitions and a protected field.
However, I have one use case where I copy data into this table, from a source that also has these entries, and I want to copy them as well. But when my script copies the data, it triggers the auto-calculation, and in the end, my "changed at" is set to the current time and "changed by" to the current user. I want to retain whatever my external source has in these fields.
How can I temporarily disable the auto-calculation for these fields in FileMaker, so that for the duration of my script, they act as normal fields and simply take the data I enter?
Upvotes: 0
Views: 326
Reputation: 2980
Change your auto-entered modification fields as follows
Then set the auto-enter calculation to something like the following
Let ( trigger = GetField ( "" ) ; If ( $$SilentSync > 0 ; Self ; Get ( CurrentDate ) ) )
You'll need to change the Get ( CurrentDate )
to whatever is appropriate for that field, and you'll need to do this for all modification fields in every table.
After this these fields will work as normal during day-to-day editing etc.
When setting data during your sync you can use the following at the beginning of the sync process
Set Variable [$$SilentSync: 1]
Then clear $$SilentSync at the end of the sync process
Set Variable [$$SilentSync: ""]
Upvotes: 1