This is the part 3 of DateEffective Framework part 2 is here.
So let start first with the CreateNewTimePeriod Mode.As i told you before ,we have a property ‘ValidTimeStateUpdate’ on the datasource of the form(se below) having value ‘CreateNewTimePeriod by default.
It creates a new record as of current date,means it has ‘ValidFrom’ date as of current date.It expires the updated record by making the ValidTo -1 of the updated record with respect to the valid From of the new record.In this mode user wont have any idea about the existing records.User only sees the current record,but internally history is maintain.
So if use update the record,let say Price has been jump to 100,so user will be creating a new record with the updated Price value.On the mid of the year.Let say today is 6/1/2012
- ValidFrom:6/1/2012(current date)
Existing Record:(Now Expired or closed)
Let use Currency form.with the ValidTimeStateUpdate = ‘CreateNewTimePeriod’
Here We have a current record Effective = 1/1/2012 Expiration = Never
Now I want to update the record and make the Price 100
So look what happen,it creates a new record(i have created a new record).It sets the Expiration value to currentdate-1 and create a new record with current date.
Also note the in ‘CreateNewTimePeriod’ the only record we can update(not readonly) is the current date.here above we have expired/closed record .
This is the current record and we can edit it.Now lets create a Future record see what happens see below
On creation of future record following things happened.
- It adjusted the Expiration of the current record with respect to the Effective of Future record
- It did not give me any MESSAGE BOX for the change.But it did it.
- Also it makes the future record read only as well.
Correction:Updating the record in correction mode is as same as updating the record in normal terms.In this mode if ‘ValidFrom’ or ‘ValidTo’ dates are updated the other existing values are automatically adjusted,to maintain the overlap or a gap.
So lets take example of Currency form again, i have set the property to Correction in datasource
I have a record in Correction mode ,now i am going to create an expired/past record
I have put the Effective = 1/1/2011 and Expiration = 12/31/2011,Since the Effective of the current record is 1/1/2013 so there is gap.So it prompts for the adjustment notification
i press Yes button see what happens
Effective of the current record adjusted with the Expiration of the past record.
Now,I have created the similar record but for future, the records are again adjusted(see below)
Now lets delete the record from the middle
It again shows for the adjustment confirmation.Press Yes then
Delete record confirmation record .Press yes button
So here what happens is.Since the middle record is delete ,so the Expiration date of the Past record(see in above screen) is now set the Effective – 1 with respect to the Future record.
So here the attraction of DateEffective framework.User don’t have to worry about the date adjustments,framework will be automatically
Effective Based: It is just the combination of the two modes i.e ‘CreateNewTimePeriod’ and ‘Correction’.When updating a valid time state table in EffectiveBased mode, if the record being
updated is a current record, the record is updated in CreateNewTimePeriod mode. If the record being updated is a future record, the record is updated in Correction mode. If the record is a past record, the record cannot be updated.
So now you will have the idea of all three modes,please let me know about queries
Have a nice day!