HPE Service Manager / Service Center Support and News Forum
Showing results for 
Search instead for 
Do you mean 

validation in Subroutines

Regular Advisor

validation in Subroutines

Hi ,

 

Validation need to perform in FC subroutines

 

I have a field $min

 

if user enters the values above 60 , popup should appear "Please eneter between 0 to 60"

 

how to do it in subrotines

5 REPLIES
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?

 

Regular Advisor

Re: validation in Subroutines

Hi,

It was working good in FC vaildation,
Can you tell me how to restrict for special characters
Honored Contributor Honored Contributor

Re: validation in Subroutines

The isnumeric rtefunction will ensure the value in the field is a number.  That will exclude anything that isn't a number.

 

If you want to _include_ special characters, the isnumeric function allows you to pass a comma delimited string of characters to allow.

 

$L.void=rtecall("isnumeric", $L.rc, $min, "#,$,%,^,&,*")

 

Will allow any of the characters listed as well as any number; however, your second validation will fail, becuase $4 is not a number between 0 and 60.

Regular Advisor

Re: validation in Subroutines

Hi ,

for this one

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

if i enter numberic value , message is getting displayed
Highlighted
Regular Advisor

Re: validation in Subroutines

Hi ,

 

when i use this below validation in fc it was not showing the error message for >,<,=,#

 

validation - rtecall("isnumeric", $L.rc, $hr, "#,$,%,^,&,*")

update - not null($hr)

Message - Special Characters , Alphabets are not allowed

Set Focus To - $hr

 

Please help me.