Calculated field with $$OBJCODE doesn't get recalculated
Hi All,
a calculated custom field of mine is behaving like a bad boy. Can someone please help me with taming it? : )
I have a form that is attached both to the Task and Issue objects.
The form contains a calculated field (called ObjcodeDebugCombined) that is meant to flag up if certain settings on the Task/Issue record are not aligned to the expectations, i.e.:
- On a Task: the Task Constraint is not "Fixed Dates" OR the Duration Type is not "Simple"
- On an Issue: the Issue type is not "Request"
Here's the calculation:
IF(($$OBJCODE="TASK"&&({durationType}!="S"||{taskConstraint}!="FIXT"))||($$OBJCODE="OPTASK"&&{opTaskType}!="REQ"),"failed","")The problem is that this field is not recalculated when it should be. More precisely:
- When a Task/Issue record is created (with the custom form attached), the field is calculated correctly.
- When another custom field is updated on the Task/Issue record, it (ObjcodeDebugCombined) is recalculated properly.
- When a native field (e.g. name, planned start date, etc.) is updated on the Task/Issue record, it is not recalculated.
- When I click "Recalculate Expressions" on the Project, it is not recalculated.
- When I click "Recalculate Expressions" on the Task/Issue, it is recalculated.
The problem is scenario 3., because updating the Task Constraint / Duration Type / Issue Type field falls into this, i.e. updating those does not trigger the recalculation, so ObjcodeDebugCombined shows "failed" even after the user has fixed the incorrect setting.
I believe that the problem is related to the $$OBJCODE wildcard, because when I created similar fields without it, separately for the Task and Issue records, those just worked fine:
IF({opTaskType}!="REQ","failed","")
IF({durationType}!="S"||{taskConstraint}!="FIXT","failed","")Obviously I need a single field that works for both Tasks and Issues.
I appreciate any ideas.
Thank you,
Tibor