When using the existing field within the data definition no limits are placed on the date range a user can enter. In order to restrict users to a specific date range the following steps can be taken:
Ø Add date to Selection Criteria (Page 2)
Ø Create the computed field Page (3)
o b.field.name
o c.field.name
o e.field.name
Ø enter the attributes screen for any of the above selections and place the following code:
o FCL1=@.new>@.today
o FCL1A=@W.err(" Future date not allowed!")
Ø The @.new>@.today checks the new value to see if it is Greater than today. If this is true then it will produce the error text using W.err.
Ø This can also be done using an IF statement
o IF{@.new>@.today @W.err(“Future date not allowed!”)}
Ø You can also use either of these statements to restrict the range to only be future dates or for today only.
o FCL1=@.new<@.today
o FCL1A=@W.err(" Future date not allowed!")
OR
o IF{@.new=@.today @W.err(“Future date not allowed!”)}
Either one of these formats will force the user to re-enter a date with in the desired date range.