Question
srcLogic
US
Last activity: 19 Sep 2016 12:07 EDT
@DateTime functions not working
Hello,
I am confused why all my DateTime functions are not working. I am using 7.2.1 and when I try to use the any DateTime function the error shown in the screenshot is thrown. I looked through my rulesets and it seems that these functions are in Pega-Rules 7-10-10 whereas my app was searching through 7-10-26. Is that the problem? How do I get access to these functions?
Isabella
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
GB
The function signature in the validation error is:
addToDate (ClipboardPage, int, ClipboardPage, ClipboardPage, ClipboardPage)
The validation error you see is correctly indicating there is no function with the signature as it is provided in your case.
The actual function signature for addToDate in DateTime the should be "addToDate (String, String, String, String, String)" to match the existing function.
Here is the Help that you can see when you hover over the function in exporession builder that explains this:
Signature:
String addToDate (String theDate,String days,String hours,String minutes,String seconds)
Library : DateTime
Description :
Adds the given days, hours, minutes, and seconds to the DateTime passed in (or the current DateTime if no DateTime is passed) and returns the resulting DateTime as a String.
Usage :
This function will add days, hours, minutes, seconds to the given DateTime and will return a DateTime string.
Parameters:
theDate: base date to start with.
days: days to add to base date.
hours: hours to add to base date.
minutes: minutes to add to base date.
seconds: seconds to add to base date.
Example:
addToDate('20090109T162504.370 GMT', '1', '1', '1', '1') = '20090110T172605.370 GMT'
The function signature in the validation error is:
addToDate (ClipboardPage, int, ClipboardPage, ClipboardPage, ClipboardPage)
The validation error you see is correctly indicating there is no function with the signature as it is provided in your case.
The actual function signature for addToDate in DateTime the should be "addToDate (String, String, String, String, String)" to match the existing function.
Here is the Help that you can see when you hover over the function in exporession builder that explains this:
Signature:
String addToDate (String theDate,String days,String hours,String minutes,String seconds)
Library : DateTime
Description :
Adds the given days, hours, minutes, and seconds to the DateTime passed in (or the current DateTime if no DateTime is passed) and returns the resulting DateTime as a String.
Usage :
This function will add days, hours, minutes, seconds to the given DateTime and will return a DateTime string.
Parameters:
theDate: base date to start with.
days: days to add to base date.
hours: hours to add to base date.
minutes: minutes to add to base date.
seconds: seconds to add to base date.
Example:
addToDate('20090109T162504.370 GMT', '1', '1', '1', '1') = '20090110T172605.370 GMT'
To fix this validation error, try quoting the function parameters once added to the expression builder.
@DateTime.addToDate("theDate", "days", "hours", "minutes", "seconds")
e.g.
@DateTime.addToDate("20090109T162504.370 GMT", "1", "1", "1", "1") which would give the result '20090110T172605.370 GMT'
Pegasystems Inc.
IN
Hi
Can you try log in as Proprietary information hidden and try using the same function and share the result ?
srcLogic
US
Sure, what is the login?
srcLogic
US
Sure, I am not able to change the password for that account so how do I login?
Accepted Solution
Pegasystems Inc.
GB
The function signature in the validation error is:
addToDate (ClipboardPage, int, ClipboardPage, ClipboardPage, ClipboardPage)
The validation error you see is correctly indicating there is no function with the signature as it is provided in your case.
The actual function signature for addToDate in DateTime the should be "addToDate (String, String, String, String, String)" to match the existing function.
Here is the Help that you can see when you hover over the function in exporession builder that explains this:
Signature:
String addToDate (String theDate,String days,String hours,String minutes,String seconds)
Library : DateTime
Description :
Adds the given days, hours, minutes, and seconds to the DateTime passed in (or the current DateTime if no DateTime is passed) and returns the resulting DateTime as a String.
Usage :
This function will add days, hours, minutes, seconds to the given DateTime and will return a DateTime string.
Parameters:
theDate: base date to start with.
days: days to add to base date.
hours: hours to add to base date.
minutes: minutes to add to base date.
seconds: seconds to add to base date.
Example:
addToDate('20090109T162504.370 GMT', '1', '1', '1', '1') = '20090110T172605.370 GMT'
The function signature in the validation error is:
addToDate (ClipboardPage, int, ClipboardPage, ClipboardPage, ClipboardPage)
The validation error you see is correctly indicating there is no function with the signature as it is provided in your case.
The actual function signature for addToDate in DateTime the should be "addToDate (String, String, String, String, String)" to match the existing function.
Here is the Help that you can see when you hover over the function in exporession builder that explains this:
Signature:
String addToDate (String theDate,String days,String hours,String minutes,String seconds)
Library : DateTime
Description :
Adds the given days, hours, minutes, and seconds to the DateTime passed in (or the current DateTime if no DateTime is passed) and returns the resulting DateTime as a String.
Usage :
This function will add days, hours, minutes, seconds to the given DateTime and will return a DateTime string.
Parameters:
theDate: base date to start with.
days: days to add to base date.
hours: hours to add to base date.
minutes: minutes to add to base date.
seconds: seconds to add to base date.
Example:
addToDate('20090109T162504.370 GMT', '1', '1', '1', '1') = '20090110T172605.370 GMT'
To fix this validation error, try quoting the function parameters once added to the expression builder.
@DateTime.addToDate("theDate", "days", "hours", "minutes", "seconds")
e.g.
@DateTime.addToDate("20090109T162504.370 GMT", "1", "1", "1", "1") which would give the result '20090110T172605.370 GMT'
srcLogic
US
Thank you! That was the problem.