Solved

String Validation Code

Posted on 2003-11-14
2
197 Views
Last Modified: 2013-12-18
I'm too lazy to figure out the syntax in notes to do this
I need to validate a field in a form before the its saved.

Heres the Validation Criteria

XXXXX-000-XX-X-XX

X=Alpha Numeric
0=Number

The user has to enter the dashes as well....

Heres the code I have....

Sub Click(Source As Button)
      Dim workspace As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      Set uidoc = workspace.CurrentDocument
      If uidoc.FieldGetText("fldSKU")="" Then
            Messagebox "Please Enter a SKU Number"
      Elseif
=================CODE GOES HERE=============================
      Else
            uidoc.Save
            uidoc.close
      End If
End Sub
0
Comment
Question by:marefin
2 Comments
 
LVL 2

Accepted Solution

by:
ksi2001 earned 50 total points
ID: 9749094
>I'm too lazy to figure out the syntax in notes to do this

and you think 25 points is enough to get me out of laizyness?

use InputValidation event for the field and formula language

FIELD fldSKU:=fldSKU;
@If(@Matches(
@UpperCase(fldSKU);
"{A-Z}{A-Z}{A-Z}{A-Z}{A-Z}-{0-9}{0-9}{0-9}{0-9}-{A-Z}{A-Z}-{A-Z}-{A-Z}{A-Z}");
@Success;@Failure("Please input fldSKU in the form of XXXXX-000-XX-X-XX"))


0
 

Author Comment

by:marefin
ID: 9749144
ok 50 points for not being as lazy as me
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question