Solved

String Validation Code

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now