4 Replies Latest reply on Feb 22, 2016 10:05 AM by Fabian Schmidt

    Counting True Boolian's from a linked object

    Guy_Walton Apprentice

      I'm trying to add a new field to our incident window that counts the number of Boolean true value for a field call ChaseRequested on the note window. But  I think I have something configured incorrectly.

       

      On the incident object I have a Int32 value attribute setup, that has the calculation type set to "Before Save" with the formula set to

      import System

      static def GetAttributeValue(Incident):

        Value = 0

        falsecount = 0

        for Notes in Incident.Notes:

           if Incident.Notes._ChaseRequested !=null :

               if Incident.Notes._ChaseRequested ==true :

                     Value ++

      return Value


      But all this appears to do it return 0 for all instances, regardless of the value of ChaseRequested on the notes window

       

      Does anyone have any suggestions , I even tried setting Value to default to 5 to start the calculation and 0 is still returned