SM TIP: Calculate the duration between two dates fields using a ruleset PD.
- Go to Process Designer and create a new ruleset (as example I used planned.start and planned.end fileds from the cm3r table and I saved the calculation into datedifference2 field (datetime type)):
- Condition: ( planned.end in CurrentRecord != 'NULL')
- Code: record.datedifference2=DateDifference.calculateDifference(record.planned_start,record.planned_end)
- Add the ruleset created to the workflow(s) you want. In this example I added to the workflow properties instead of a specific phase but it’s all up to you.
- You’ll get something like this as a result:
If you feel this was helpful please click the KUDOS! thumb below!