What is the syntax for validation script for a date widget

147 views
Skip to first unread message

ii2team...@gmail.com

unread,
Oct 28, 2014, 1:16:45 PM10/28/14
to suppor...@runmyprocess.com
I have tried the below code in a script widget and able to get proper result.
But it is not able to implement the same on the validation rule script in the rule tab.

Sample code:

my_date = new Date();
currentTime = Math.round(my_date.getTime()/ 1000);

if (id_issued_date.getDate() > currentTime) {
alert("wrong");
}
else {
alert("right");
}

Jeremy Le Pré

unread,
Oct 28, 2014, 1:30:23 PM10/28/14
to suppor...@runmyprocess.com
Hello,

The validation rule script should end on a "true" or "false" output data.

You can eventually make a call, to process a data, to a function declared in another javascript. Or you can do as follow:
Add a javascript in a Javascript field widget. It will look like the following : RMPApplication.addListener(valueChanged ); function valueChanged(name,value) {if (name == "email_to") {alert("New value : "+value);}}

Use the following document about the imput fields:
http://docs.runmyprocess.com/User_Guide/Development_Environment/Toolbox/Web_Interfaces/Widget/TextInput_Widget

Regards,

______________________________________
Jérémy LE PRÉ

PreSales Engineer at RunMyProcess

WebsiteFujitsu RunMyProcess


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/df5742d0-0186-44ef-aaaa-23a5ad58c50e%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

ii2team...@gmail.com

unread,
Oct 28, 2014, 1:56:02 PM10/28/14
to suppor...@runmyprocess.com
can i have a 'if else' condition mentioned like below in the validation script?

Sample code:

if(condition)
return false;
else
return true;

Jeremy Le Pré

unread,
Oct 29, 2014, 5:46:37 AM10/29/14
to suppor...@runmyprocess.com
Hello,

You should be able to make this kind of verification inside your data validation script.

Bidisha Das

unread,
Oct 29, 2014, 8:00:28 AM10/29/14
to suppor...@runmyprocess.com
Hi,

In the validation script of your date widget ,you just need to call the function of your js code mentioned in the above link like: function_name("[[numeric date variable]]") .It should work.



Thanks & Regards
Bidisha
Reply all
Reply to author
Forward
0 new messages