Troubleshooting Guide
Fix Calculated Formulas
2 min
if your swimlane instance throws 500 errors when you click on records or when you try to open an application, you might pull errors similar to this { " id" objectid(“\<object id>"), "date" isodate(“\<data>“), "hostname" “\<host name>", "layoutname" "fulldebug", "level" "error", "username" “\<user name>”, "methodname" "core engines calculation calculator performcalculationsforrecord", "linenumber" “\<line number>", "message" "error calculating formula for field \”\<field name>\” on record <“record id>, "applicatonid" “\<application id>“, "exceptionmessage" "object reference not set to an instance of an object ", "exceptionmethod" "system object calculate(core models record record, core models application application, system string)", "exceptiontype" "system nullreferenceexception", "exceptionstacktrace" "at core engines calculation calculator calculate(record record, application app, string formula) in /app/core/engines/calculation/calculator cs\ line \<line number>\n at core engines calculation calculator performcalculationsforrecord(record record, application app) in /app/core/engines/calculation/calculator cs\ line \<line number>“, "exceptionwithinner" "system nullreferenceexception object reference not set to an instance of an object \n at core engines calculation calculator calculate(record record, application app, string formula) in /app/core/engines/calculation/calculator cs\ line \<line number>\n at core engines calculation calculator performcalculationsforrecord(record record, application app) in /app/core/engines/calculation/calculator cs\ line \<line number>“ } more than likely, this error means you have calculated fields that are not failing because they aren't accounting for empty fields for example, you have a calculated field, case tt resolved min whose calculations depend on case created on and case closed on fields you will get an error if those two files are not populated correctly chances are these fields are using a formula similar to the following if (\[case created on] = \[case resolved on], 0, totalminutes(\[case created on],\[case resolved on])) notice that this formula is only checking if two fields are equal in order to skip the calculation and return 0 however, it is not checking whether case created on or case resolved on fields are empty the fact that these fields are indeed empty is likely causing the issue to confirm if this is the issue, open the problematic record(s) and check if all the fields are populated if they are not, you have found the problem! to fix this issue from the swimlane global navigation menu, select applications & applets select the application or applet that is causing the error select the fields in the form layout and select edit to open the calculation builder change the formula by adding “or” and “isblank" to allow for the empty fields, for example if (or(\[case created on] = \[case closed on], isblank(\[case created on]), isblank(\[case closed on])), 0, totalminutes(\[case created on],\[case closed on]))