In general, it is not recommended to place EventScript directly into an unstored calculation field. Under Windows, if you want to print a layout where you placed an unstored calculation that includes a pure script trigger, then FileMaker 7 and/or FileMaker 8 will unexpectedly crash!
Example :
1 & S4HU_EventScript( Get(FileName) ; "CreateNew"; "")
or see the screenchoot below:

Two(2) easy workarounds to this printing bug is:
1. Make sure your calculation can be indexed by FileMaker so it won't be re-evaluted at the printing time.
2.a If your calculation has to be unstored and you have to print this layout, then add this simple condtion to your calculation trigger:
If ( Get(WindowMode) ≠ 3;
1 & S4HU_EventScript( Get(FileName) ; "toto"; "")
;"")
The Get(WindowMode) function is equal to 3 when FileMaker is entering his printing process. So this 'If' statement will prevent FMP to evaluate the trigger and will then prevent FMP to crash.
2.b Another solution if this trigger field doesn't have to be printed on this layout is to make the field as a "non-printing" object (see the Format + Set Sliding/Printing option).
Please note that this problem doesn't happen under FileMaker for Mac OS X.
top
|