You can put fields of type calculation on a layout and it will evaluate correctly whether the fields referenced in the calculation are present on the layout or not.
I think you need to describe your calculation field in more detail and what exactly you mean by "won't function".
"calculation" fields might be a field of type calculation, a data field such as text or number with an auto-enter calculation or even a data field with a script trigger that uses a script to assign a calculated value. And there are setting differences for each that can make a difference in how they evaluate.
Here’s the design in detail...
A button action records the Current Time in a reference field that represents the Start Time.
A second button action records the Current Time in a second field that represents the End Time.
A third field contains a calculation that references the Start and End Time fields and calculates the elapsed time.
For some reason, if I omit the Start and End Time fields from the layout, the third field (calculation field) fails to return a result. However, if I do include the Start and End Time fields in the layout, the third field will populate.
And what exact method did you use to insert the current time in those fields?
My guess is that you used a script step that starts with "insert".
If you used:
Set Field [YourTable::Field ; Get ( CurrentTime ) ]
The target field would not need to be present on the current layout.
Script steps that start with "insert" on the other hand silently fail to work if the target field is not present on the current layout.
Your hunch is correct! I wasn’t aware of that limitation. Indeed, both the Start Time and End Time fields each had a button to insert the Current Time using the following button action:
Insert Current Time [Name of TargetTable: :Field]
I’ll change to buttons’ actions to use the Set Field script you describe. Thank You
The following script steps directly interact with field objects on your layout and thus: a) fail to work if the specified field is not present on the layout and b) the script step trips script triggers such as OnObjectEnter or OnObjectModify if they are set up on the field object:
Any script step that has "insert" as the first word of its name.