Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
517 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...