Solved

String Validation Code

Posted on 2003-11-14
2
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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