Skipping Calculation during save
When a user modifies an ingredient or a parameter in a formula, the application may take a long time to perform the calculations before the formula can automatically be saved.
To reduce the processing time, you can skip the calculation process using this script on the Script tab of the Formula symbol in which the CALCSTATE attribute is set to 2. Validation such as status, class is important to ensure the calculation is skipped only in the exact scenario. For example:
dim sClass as string = ObjProperty("CLASS")
if sClass = “NOCALC” then
ObjPropertySet("2", 1, "CALCSTATE")
end if
Note:
- Global calculation is applicable for all formula calculations. This process is not skipped due to the Presave script.
- You must ensure that formulas are calculated before final approval or export of data as this script can generate inaccurate results.