Question
wipro
IN
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.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
I think probably the best approach to achieve this scenario is using Validation.
- For "if user selects more than that error message should be displayed ", this you can use Edit Validate/Validation rule similar to "NonFutureDate" standard edit validate rule
- using the same validation, you can try to disable using CSS
I haven't tried this out, but you can give it a try.
Hope this helps.
Best Regards,
Mounika
wipro
IN
Hi Mounika,
here we have to fetch date based on decision table.Like for reason "X" the maximum date that should be available to select is 30 and minimum date should be 1.
Rest all date should be greyed out and if user clicks it should get error message.
Pegasystems Inc.
IN
Hi,
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.
wipro
IN
Hi ,
Appreciate your help!!
Do you have any JSP code which i can reuse and customize,
Areteans Tech
AU
hi ,
first create a decision table . .i.e for x get 30 , for y get 10,
On change of date field , actions > run activity ,
Step 1 : call the decision table and get the value in the property (Param.pylabel)
Step2: add the today date to 30(for x) or 10 (for y) and get the max date.
step 3:check selected date > this maxdate ,
if true do property-set-message and set error msg
if false , skip the step.
Let us know if this works.
wipro
IN
Hi Ashok,
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.
Areteans Technology Solutions
AU
Hi,
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.
Let us know if this helps.
Regards,
Ratan Balaji.
wipro
IN
Hi Ratan,
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.
Let me know if you need more clarification
Areteans Technology Solutions
AU
Does that mean the screen has 3 input fields?
1) Reason
2) From Date
3) To Date
wipro
IN
Hi ,
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,
Areteans Technology Solutions
AU
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.
Let me know if this helps
wipro
IN
Thanks !! Will try to implement and let u knw.
wipro
IN
Hi ,
I have another think to ask,based on above solution can we make sure Date picker should not allow less than Min Duration or more than Max Duration to be selected..
Areteans Technology Solutions
AU
Yes, this will make sure that when you choose a date that s out of range, you will get an error message on screen after post value.