Highlighted
Trusted Contributor.
Trusted Contributor.
784 views

Validation: avoid to set a past date!

Jump to solution

Hello experts,

I'm writing a validation on SM 7.11 to avoid users to set a past date in a specific form.

I'm trying to achieve this through the Validations form of SM (I'm not that expert...) and the form seems to me easy and clear:

Form values

file=fileName
form=formName
field=$value9

 

Query

Add: false
Update: $value9 in $file<tod()
Delete: $value9 in $file<tod()
Set Focus to: $value9 in $file

 

As result I receive back this error:

Process panel calc.validations in RAD format.cval encountered error in line 8 (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
Bad arg(1) oper = (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
Bad arg(1) oper  and  (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
Bad arg(1) oper < (format.cval,calc.validations)
Cannot evaluate expression (format.cval,calc.validations)
cannot use TIME as index (format.cval,calc.validations)
Validation expression no: 22 CANNOT be evaluated.

 

My Validation is the °22 in order so I assume I wrote something wrong obviously. I looked for this error but I did not found anything useful.

  • Can you help me to achieve this through this validation?
  • Also, is it possible to achieve the same through a JS script? If yes, can you please be so kind to write me an example?
  • Last but not least, is there some specific manual or white paper to helo me understand the logic of SM format control?

 

Thanks to all.

 

 

Luca

Tags (3)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Validation: avoid to set a past date!

Jump to solution

Hello,

You have to remove $file.

 

You dont use file variables with custom variables like $value9.

 

Also play with <> sign as I can not understand are you checking it for being earlier then tod or later then tod

View solution in original post

6 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Validation: avoid to set a past date!

Jump to solution

Hello,

You have to remove $file.

 

You dont use file variables with custom variables like $value9.

 

Also play with <> sign as I can not understand are you checking it for being earlier then tod or later then tod

View solution in original post

Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Validation: avoid to set a past date!

Jump to solution

And what do you have in validation box?

Suppose you have to remove the condition values which you did set with just true. In case if you want it to work anything. Or for not null(Your_field)

and in validation box write the condtion with  $value9>tod()

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Validation: avoid to set a past date!

Jump to solution

Hello, thanks for the useful information.

I did follow your suggestion and now the validation is working but with an unexpected behaviour.

The Validation pop-up shows up only when I press "OK" or "Close" or "Delete" and not when I press "Save". AM I doing something wrong?

Query:

 

Validation: null($value9)
Add: $value9<tod()
Update: $value9<tod()

How can I set the control to understand if the value is wrong when I save the activity?

 

 

Thanks for the help, really appreciated.

 

 

Luca

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Validation: avoid to set a past date!

Jump to solution

Actually Ok is saveok (mostly).

It should work with save when you have it for update format control validation. Check what values do you have inn the variable at saving with RAD debugger. Maybe you don't meet conditions.

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Validation: avoid to set a past date!

Jump to solution

Thanks Vadim, you helped me a lot!

 

Best regards!

0 Likes
Highlighted
Visitor.

Re: Validation: avoid to set a past date!

Jump to solution
how do I delete $ file,
thanks for your help
 
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.