Solved

String Validation Code

Posted on 2003-11-14
2
196 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 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