we are working in some customization and a question had been raised to me that , is the validstate fields (ValidFrom-ValidTo ) allow date overlapping
Ex:- suppose that i have a shift table and i wanna the worker to have valid from to valid shift
worker shiftcode ValidFrom ValidTo
0001 sh0001 1/4/2013 1/5/2013
what will happen if some assign another shift in different dates but in the same month
0001 sh0002 15/4/2013 15/5/2013
how to prevent date overlapping like the above example ?????
As far as I know there are no issues with overlapping in the framework for valid time state tables. The framework was specifically designed to prevent overlapping:
"The system guarantees that the values in these date or date-time fields remain valid by automatically preventing overlap among date ranges. "
Try below code,
1. At the modified method of "ValidateFrom" field, check that "validatefrom" value should be greater than the value of "ValidTo" field (for this particular Worker) value.
2. At the modified method of ValidateTo field write code to validate the ValidTo value should be greater than ValidFrom value.
I hope this will help you..
- Thanks & Regards
Use a valid time state table.
i am using it already but i wanna to make sure that there is no overlapping issues
i wanna just to make sure that every thing is ok
What About time
like if i had shift table like the below table
i want to prevent overlaping in Time values not in DateTime values like the below table
The valid time state table framework does not support time only fields, only date or datetime fields. So in this case you would have to write your own validation similar to what Agarwal AX described.