Isabel,

If you can use Remedy's built in formatting codes, as Michiel mentioned, with 
only one or two active links then I think that would be the way to go.  

For detailed validation or formatting operations my preference is to use the 
DBMS.  By creating a user defined function you can validate your entries with 
only a single call from your workflow.  It runs quick and makes it easy to call 
from anywhere in your system.

Ie. Set Fields SQL  SELECT dbo.udf_MyValidationFunction('$Field To Validate'$)  
 
The function could return 1 or 0 or 'Y' or 'N' to your workflow.

To make the function more adaptable you could use a single function for all of 
your validation by adding another parameter indicating which validation method 
is needed.

Ie. Set Fields SQL  SELECT dbo.udf_MyValidationFunction(1, '$Field To 
Validate'$)  
In your function the parameter value of 1 would run the particular validation 
routine.  For a different type of validation in another area of your system you 
could pass the number 2 into the function, etc.

HTH

Stephen


________________________________

From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] 
On Behalf Of Michiel Beijen
Sent: Friday, October 06, 2006 9:27 AM
To: [email protected]
Subject: Re: Data validation/pattern matching/control characters


** Hi isabel,

a best practice would be to use whitelisting instead of blacklisting, so say: 
only [A-Z] and [a-z] and [EMAIL PROTECTED]&] so on.
I guess you can pull this off using a guide but I am not sure how this would 
impact performance, I think it would not be really great. 
If you have the skills at hand, using Perl, and especially the arfperl plugin, 
might be a fast and nice solution for this. 
Look at this URL for an article on the Remedy website on this topic:

http://www.remedy.com/customers/dht/archive/10-20-2003.htm

Kind regards,

Michiel


On 10/6/06, Ross, Isabel < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > 
wrote: 

        ** 

        Hello

        I've been asked to put some validation against some of our name and add 
ress fields.  These are entered on a display only form, and need to be 
validated on a button push (ie well before the call has been submitted). 

        Typical rules for the various fields are: 

        1.      can contain alpha characters and hyphens (-), but no other 
control characters 
        2.      must contain numbers only 
        3.      can contain alpha characters, full stops(.) and apostrophes(' ) 
but no other control characters 
        4.      can contain alpha charactors and forward slashes(/) but no 
other control characters. 

        I'm not sure of the best way of checking for almost all control 
characters.  Also I 'd like to find a neat way of doing this that means the 
code can be reused or amended without too much hassle.  Thoughts so far: 

        Option 1

        Create a form called PatternMatch, which will contain FieldName, P 
attern (eg "[a-A][a-A] ") and ErrorMessage.  It would then have a display only 
field and when the pattern match test is run, the value in the field being 
tested would be pushed through the display only field and would generate a 
user-friendly error if it didn' t match the pattern. 

        Problems: I can't find full documentation for this pattern matching, 
and I 'm not sure if its flexible enough to handle rules 1, 3 and 4 above.

        Option 2

        Use SQL?

        Option 3

        Use a guide.  Create a form that stores all the possible control 
characters as individual record s (eg ! " £ $ etc) then retrieve each record 
one by one and check if FieldToCheck LIKE "%" +$ControlCharacter$+"%" .  And 
then find some way of making exceptions for control characters that are only 
allowed in certain fields ...

        Option 4

        Something completely different involving ascii codes or something. 

        Any thoughts on the best approach?

        ARS Version 5.0 (soon to be 6.3, all going well)

        Solaris 9

        Oracle 9

        Isabel Ross

        Internal: 31484

        External: 0141 418 1484

                
        
        Support Scotland's Bid to host the 2014 Commonwealth Games in Glasgow - 
visit www.glasgow2014.com
        
        
----------------------------------------------------------------------------
        Disclaimer:
        This message is intended only for use of the addressee. If this message
        was sent to you in error, please notify the sender and delete this 
message.
        Glasgow City Council cannot accept responsibility for viruses, so please
        scan attachments. Views expressed in this message do not necessarily 
reflect
        those of the Council who will not necessarily be bound by its contents.
        
----------------------------------------------------------------------------
        
        __20060125_______________________This posting was submitted with HTML 
in it___ 


__20060125_______________________This posting was submitted with HTML in it___

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org

Reply via email to