I want to set a Boolean field on in the incident form to be true if a field on any item in a collection on the incident is set to true.
On our incident table we have a collection called OrderItems, and if the field "Chargeable" it set to true on any of the items for that incident then the calculation sets the field on the incident form to true.
This is my calculation at the moment
Type: Before Save
static def GetAttributeValue(Incident):
#value = false
#for item in Incident._OrderedItemsCol:
##if item._Chargeable == true:
###value = true
# = 1 Space
It works, if on the first item in the collection the field is true. But if the first item is set to false and the second item is set to true, my calculation does not work.