There I created a script called Calculate and entered this.calculateNow();
The form does do calulations but I always get the following error.
f has no propertiesException in line 1166 of function AFSimple_Calculate, script
Exception in line 1 of function top_level, script Field:Calculate
That probably means that one of the fields that you've set up to use one of the built-in calculation methods is trying to use a field that no longer exists. For example, you may have set up a calculated field to sum "Text1" and "Text2", but later renamed either or both fields to something else, or removed one or more of the fields. You just have to find the calculated field and fix it.
And what is code for the function?
If you are calculating a variable's value, you may need to verify it was calculated with a correct value.