Validation rule for date widget in array widget

228 views
Skip to first unread message

yves.d...@gmail.com

unread,
Jul 16, 2015, 4:23:43 PM7/16/15
to suppor...@runmyprocess.com
Hello,

With a date widget, following script in validation rule works fine :
if (parseFloat([[date]])<1429099200)
{alert ("Date must be after April,15th, 2015 included");
id_date.setValue("");
false;}
else{true;}

var my_date = new Date();
var today = Math.round(my_date.getTime()/ 1000);
if(parseFloat([[date]])> today)
{alert("Date can't be in the future !");
id_date.setValue("");
false;}
else{true;}

When the date widget is included into an array, the equivalent script below doesn't react :
if (parseFloat([[my_array.date]][P_index])<1429099200)
{alert ("Date must be after April,15th, 2015 included");
id_my_array.id_date[P_index].setValue("");
false;}
else{true;}

var my_date = new Date();
var today = Math.round(my_date.getTime()/ 1000);
if(parseFloat([[my_array.date]][P_index])> today)
{alert("Date can't be in the future !");
id_my_array.id_date[P_index].setValue("");
false;}
else{true;}

When tested in the JS tester with P_index replaced by 0, it works.

Why is the validation rule of date widget not working in the array ?

Regards
Yves

Pankaj Kumar

unread,
Jul 17, 2015, 3:08:43 AM7/17/15
to suppor...@runmyprocess.com, Yves de VEYRAC, Yves de Veyrac
Hi Yves,

It seems the validation is not working in the controls inside the array widget, we will check on this.

For the validation, you can follow the other approach:-

Add another column in the array of js type and make it invisible, and use the "Listen to varibale" with giving value like "my_array.date[P_index]", add the validation code in the script.

sample code in script:-

if (parseFloat([[my_array.date]][P_index])<1429099200)
{alert ("Date must be after April,15th, 2015 included");
id_my_array.id_date[P_index].setValue("");
}

var my_date = new Date();
var today = Math.round(my_date.getTime()/ 1000);
if(parseFloat([[my_array.date]][P_index])> today)
{alert("Date can't be in the future !");
id_my_array.id_date[P_index].setValue("");
}

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

Yves

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" 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/2cf7ac0d-30aa-46ed-9f3e-5a0b015b5e35%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Reply all
Reply to author
Forward
0 new messages