FileMaker script steps SetField and InsertCalculatedResult may seem similar but there are some differences between them.
SetField script step can be called even if the field does not exist in the current layout but the same is not true with InsertCalculatedResult which requires the field to be present in the layout.
Insert Calculated Result contains a checkbox captioned as “select entire content” which if checked replaces your field’s old value with new calculated value. If you uncheck the option, the new calculated value replaces only a selected portion of the old field or appends it at the insertion point. SetFieldsimply adds the new value and removes the one.
Insert Calculated Result script step forcefully tries to insert result even if the data type doesn’t match with that of the field. However, it on field exit or “commit record request” an alert message to “revert record” is raised.
If you have a field ProjectDate whose data type is Date data type is Date and you run a script to “Insert Calculated Result[Select;Project::projectDate;”HELLO” ]” it will appear to have inserted the value “HELLO” in “ProjectDate” but while exiting the field, you would recieve an error message indicating that there is a datatype mismatch and the field is reverted to contain the original value.
However, SetField step will check for the datatype as you insert the vaue.
E.g: “Set Field[Project::projectDate;”HELLO” ]”
The above operation would simply “?” in the field without generating an error message.