Discussion
TCS
IN
Last activity: 25 Nov 2015 7:20 EST
i would like to display only past dates (MMDDYYYY) on Date of Birth filed
i would like to display only past dates (MMDDYYYY) on Date of Birth drop down filed, could someone help me on this, do we have any OOTB?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accenture
US
So you want to have a single drop down that has something like
01/01/2015
01/02/2015
01/03/2015
up to the current date?
Pegasystems Inc.
IN
We may either need to create a Data Transform or Activity rule to build the past dates list with a business parameter
['How many past year date options should be displayed'? 'N'].
- Step#1: Get the current date [Param.sysCurrentDate]
- Step#2: Create a new page of type 'Code-Pega-List' to hold the dates list
- Step#3: Build the results page list based on the business input parameter of 'How many past date options should be displayed'? Iterate through the parameter 'number of years (N)'. lets say N=10.
-
- so, the drop down list the years from (Date 2015 - Date 2005)
- Step#3.1: Append the page results to the new page created in step#2
- Step#3.2: Set the Year value on each page list. [(Param.sysCurrentDate) - ((Param.pyForEachCount) - 1)]
-
Please share your thoughts, Thank you!
TCS
IN
Accenture
US
Create a data page that holds the current year and all the previous years you want.
Activity to populate it can get the current date using the OOB function CurrentDateTime in the DateTime library.
Get the first 4 characters from that return, it will ne the 4 digit year.
Convert that string to in Integer/int.
Loop from 1 to number of year back you want.
Set year to year - 1: Append that value to the data page.
The data page will then contain current year as the top value and decreasing down to the range you are looking for.
Then on the section you can use a dropdown built from that data page.
Mindtree
AU
Hi,
I would like to display only past dates,is there any edit validate rule?
Pega
IN
Hi Krishna,
editvalidate rule is used to validate the input provided into the field. we have pyIsPastDate to check if a date or datetime is before current time.