Honored Contributor Honored Contributor
Re: validation in Subroutines

First - why are you doing this in subroutines? The subroutines panel in the formatctrl record is where you can tell the system to run specific RAD applications to perform functions on this record, or to do post-processing actions (like calling a script or posting data into another record.)

 

The validations panel is where you would perform validations. And for validations, if it were me, I'd set up two validations like the following:

 

Add: not null($min)

Update: not null($min)

Validation: $L.void=rtecall("isnumeric", $L.rc, $min)

Message: Please enter a numeric value between 0 and 60

 

Add: not null($min)

Update: not null($min)

Validation: $min<=60 and $min>=0

Message: Please enter a value between 0 and 60

 

The first validation checks to make sure the user entered a number, and the second validation checks to make sure it's between 0 and 60, inclusive.

 

Why would you want to do this with a subroutine?