Question
Capgemini
IN
Last activity: 22 May 2019 13:43 EDT
Custom Edit Validate
I have following requirements:
1. Creating Edit validate rule and comparing 2 dates using java code. The 2 dates are properties in application. I am unable to use other property in Edit validate rule( as 1 property can be used as 'theValue')
2. the 2 dates are in a pagelist for ex pyWorkPage.TestPage (every page in list contain 2 dates) whic needs to be compared in the edit validate rule.So my question is will this edit validate rule work in a repeating grid if not how can i address this requirement.
Below is my custom edit validate:
Thasks alot in advance!!
If you have access to the Customer Service application, there is a rule-edit-validate called CAIsStartTimeLessthanEndTime. I believe it does something similar to what you want. Here is the body of that rule if you don't have access:
String endDate= page.getProperty(".EndDate").getStringValue();
try
{
java.util.Date startdate = sdf.parse(startDate);
java.util.Date enddate = sdf.parse(endDate);
if(startdate.compareTo(enddate) != 0)
return true;
else
{
String endTime= page.getProperty(".EndTime").getStringValue();
int et = java.lang.Integer.parseInt(endTime);
return false;
else
return true;
}
}
catch(Exception e)
{
return false;
}