Posted: 1 Feb 2017 11:37 EST Last activity: 8 Feb 2017 23:17 EST
Requirement: Date default
We have a date field with calendar option where user can select days and pend it for some time.Here date should be pre populated with the reason he have selected. For example if for reason "X" the days it should be pended is 30 days...then picker should not allow more then 30 days and if user selects more than that error message should be displayed or date field beyond that should be disabled.
I think we cant achieve this through OOTB controls We need to write an customized jSP code where we need to mention the If conditions to achieve this by getting the color codes and giving them to implement the Date time control.
I have a requirement where based on reason user should not be able to select the date.
Example.For reason "X" date filed not should not allow less than Min Duration(1 days) or more than Max Duration(10 days) to be selected
For reason "Y" date filed not should not allow less than Min Duration(1 days) or more than Max Duration(5 days) to be selected.
We have total of 10 reasons and default max and minimum duration for each with different values.
Please suggest how to implement so that whnver user selects a particular reason ,date filed should alloow user to select date bewteen max and minium days mentioned and if user try to select date beyond mentioned window.error message should be displayed.
You have mentioned that the duration can be varying from 1 - 10 days based on the reason that the user is choosing. Can you tell us from which date this duration is taken into consideration? Is it from the current date?
If so i am thinking that there is going to be only one date field on screen.
1) The user selects a reason - a post value saves the user selection into the clipboard
2) The user chooses a date - on post value the validate rule associated with the property gets validated. In case of an error an error message is set on the property on screen.
The content of the validate rule:
The validate rule needs to call a decision table which checks the reason that is selected by the user. Based on the reason, the Decision Table returns a duration. Then this duration is used to validate the duration between the current date and the selected date. If it is within the duration, then no error message else error message is set on screen.
I will explain you requirement in detail.We have one field pend reason with 5 reason drop down.for each reason we have max and minimum date value.
For Example reason "X" have max and minimum day for user to select and if user select any day beyond that error message should be displayed.For Reason "X" the minimum day is 1 and max day is 30.So,whenever user selects reason "X" he should be able to select date from these max and minimum day only .
Similarly we have different days for other reasons too.
No we have two fields.1)Pend reason with five dropdown 2) we have date field.(date Picker)-here based on reason selected we have max and minimum days for which user can select date to pend for that duration.For reason"X" we have min day 1 and maax day 30 for which he can pend that case and any other day he selects other than date mentioned he should gate error message,
So, the duration is calculated from the current date as i mentioned already. Yes, in this case, have a validate rule in the property that hold the date value. This validate rule can call a decision table where you can set the reason and the allowed duration. The decision table will return the corresponding value which can be used to check if the value selected by the user falls within the value that is set in the decision table. If yes, return true, else return false.