Question Status

Verified
faress mahmoud asked a question on 10 Sep 2013 8:01 AM

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

like

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

like

worker  shiftcode ValidFrom   ValidTo

0001     sh0002    15/4/2013     15/5/2013

how to prevent date overlapping  like the above example ?????

Reply
Verified Answer
FH-Inway responded on 11 Sep 2013 6:06 AM

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. "

Reply
Suggested Answer
Deepak Agarwal responded on 10 Sep 2013 10:46 PM

Hey Faress,

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..

Harry

- Thanks & Regards

Harry

Reply
Suggested Answer
FH-Inway responded on 11 Sep 2013 3:35 AM

Use a valid time state table.

Reply
Suggested Answer
Deepak Agarwal responded on 10 Sep 2013 10:46 PM

Hey Faress,

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..

Harry

- Thanks & Regards

Harry

Reply
Suggested Answer
FH-Inway responded on 11 Sep 2013 3:35 AM

Use a valid time state table.

Reply
faress mahmoud responded on 11 Sep 2013 5:54 AM

i am using it already but i wanna to make sure that there is no overlapping issues

Reply
faress mahmoud responded on 11 Sep 2013 5:55 AM

thanks FH-INWAY,

i wanna just to make sure that every thing is ok

Reply
Verified Answer
FH-Inway responded on 11 Sep 2013 6:06 AM

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. "

Reply
faress mahmoud responded on 18 Sep 2013 12:40 AM

What About time

like if i had shift table like the below table 

shift code Time in  Time out
0001 1.00 PM 8.00 PM
0002 8.00 PM 4.00 AM

i want to prevent overlaping in Time values not in DateTime values like the below table 

shift code Time in  Time out
0001 1.00 PM 8.00 PM
0002 5.00 PM 7.00 PM
Reply
FH-Inway responded on 18 Sep 2013 2:27 AM

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.

Reply