Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
513 views
in Technique[技术] by (71.8m points)

override last-edit field auto-calculation in FileMaker 19

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Change your auto-entered modification fields as follows

  • Switch to auto-enter Calculated value
  • Switch 'Do not replace existing value of field (if any)' off

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: ""]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...