[FileMaker] サーバーファイルかローカルファイルかの判定

Hitoshi Arakawa | 2024/06/05 Wed 04:09

外出用に FileMaker Server のデータを FileMaker Go へダウンロード(同期)する方法について書いた。

外出用に FileMaker Go へデータをダウンロードしておく | 荒川仁志 公式サイト
https://www.hitoshiarakawa.com/blogs/2024/2024-06-04_download-records-to-filemaker-go/

FileMaker Go に入れておく空ファイルは FileMaker Server のファイルを複製して流用するのが楽だ。

複製した場合、サーバーファイルとローカルファイルで挙動を変えたい時がある。例えばサーバーファイルにはダウンロードボタンはいらない。

そのためには関数を使ってサーバーファイルかローカルファイルかの判定をすればいい。

環境:
・macOS Ventura 13.5(英語環境)
・Claris FileMaker Pro 20.3.1.31

サーバーファイルならファイルパス(ファイルの保存場所)に fmnet が含まれることを利用する。

ボタンをサーバーファイル上で隠したいなら、‘Hide object when’ の欄に以下を入力すればいい。

PatternCount ( Get ( FilePath ) ; "fmnet" )

参考:
PatternCount
https://help.claris.com/archive/help/18/fmp/ja/index.html#page/FMP_Help/patterncount.html

Get(FilePath)
https://help.claris.com/archive/help/18/fmp/en/index.html#page/FMP_Help/get-filepath.html

Amazon | Apple 2024 11 インチiPad Air (M2)
https://amzn.to/3wSfe3P