Skip to main content
Hi All,

 

So the scenario is as follows: I need to capture the amount of time when a checkbox is ticket. That checkbox will be flagged and unflagged several times, so I need a field to present the sum of time when the checkbox remains flagged overall.

 

Let's say the checkbox is flagged at 12:05 and unflagged at 12:10, then reflagged again at 12:15, then unflagged again at 12:20. The field would then need to present the amount of time as 10 minutes.

 

Can this be done?

 

Thank you!
12 Antworten
  1. 22. Apr. 2015, 14:37

    Hi Razvan,

    • Create Two Datetime fields

      1. CheckboxCheckedTime
      2. CheckboxUnCheckedTime
    • Create a Number field with 0 Decimal Places : Duration
    • Create 3 Workflow Field updates

      1. Update CheckboxCheckedTime with NOW()
      2. Update CheckboxUnCheckedTime with NOW()
      3. Update Duration field with Formula

        (CheckboxUnCheckedTime__c  - CheckboxCheckedTime__c ) *1440 

        +

        IF(ISBLANK(Duration__c) , 0 , Duration__c)

         

        ​​​
    • Create 3 Workflow Rules

      1. Update CheckboxCheckedTime

        • Evaluation Criteria : Created and Everytime it's edited
        • Rule Criteria: Formula
        • AND(

          Checkbox__c,

          NOT(PRIORVALUE(Checkbox__c))

          )

        • Choose field update to Update CheckboxCheckedTime
      2. Update CheckboxUnCheckedTime

        • Evaluation Criteria : Created and Everytime it's edited
        • Rule Criteria: Formula
        • AND(

          NOT(Checkbox__c),

          PRIORVALUE(Checkbox__c)

          )

        • Choose field update to Update CheckboxUnCheckedTime
      3. Update Duration

        • Evaluation Criteria : Created and Everytime it's edited
        • Rule Criteria: Formula
        • ISCHANGED(CheckboxUnCheckedTime__c)

        • Choose field update to Update Duration field 

           
0/9000