This is to provide flexibility in how hours are entered. If I'm doing a pro bono project I might just want to enter one log per month -- 40 hours starting on 7/1. For other activities, I might actually clock in and out at a volunteering site, in which case I'd expect the hours worked to be calculated for me.
Automation:
If an hours log is created or updated with StartDateTimec and Hoursc populated and EndDateTimec blank, set EndDateTimec to StartDateTimec plus Hoursc
If an hours log is created with StartDateTimec and EndDateTimec populated and Hoursc blank, set Hoursc to EndDateTimec minus StartDateTimec
If a record is edited and Hoursc changes but EndDateTimec does not, update EndDateTimec to equal StartDateTimec plus Hours__c
If a record is edited and EndDateTimec changes but Hoursc does not, update Hoursc to equal EndDateTimec minus StartDateTime__c
Validation:
EndDateTimec and StartDateTimec are both populated, EndDateTimec must be greater than StartDateTimec
If a record is created with all three fields populated, Hoursc must equal EndDateTimec minus StartDateTime__c
If a record is edited and both Hoursc and EndDateTimec are changed, Hoursc must equal EndDateTimec minus StartDateTime__c
Notes:
We're not going to attempt calculations based on Hoursc and EndDateTimec. It's possible but it's weird and more likely user error than intentional.
There are three editable fields related to hours:
This is to provide flexibility in how hours are entered. If I'm doing a pro bono project I might just want to enter one log per month -- 40 hours starting on 7/1. For other activities, I might actually clock in and out at a volunteering site, in which case I'd expect the hours worked to be calculated for me.
Automation:
Validation:
Notes: