?
Solved

receiving a notes error upon field validation completed

Posted on 2003-03-12
17
Medium Priority
?
820 Views
Last Modified: 2013-12-18
I have some fields that have validation formulas that work fine, however when the field validation is performed and a message is displayed stating something like invalid value please reenter.  When you hit ok another error box is displayed stating Notes Error-Field didn't pass validation formula you click ok and it goes away.  Why is that second pop up box showing ???  Is there something wrong with the validation formula.  Here is a field that it happens on.
@If(
CMpkgID = ""; @Failure("Package ID is required.");
(@Middle(CMpkgID;3;1) != "2" &
@Middle(CMpkgID;3;1) != "3" &
@Middle(CMpkgID;3;1) != "4");
@Failure("Package Stage is Invalid - Please reenter valid Stage i.e. 2,3 or 4.");
(@Middle(CMpkgID;4;4) != "REFR" &
@Middle(CMpkgID;4;4) != "refr" &
@Middle(CMpkgID;4;4) != "CLMS" &
@Middle(CMpkgID;4;4) != "clms" &
@Middle(CMpkgID;4;4) != "ECOM" &
@Middle(CMpkgID;4;4) != "ecom" &
@Middle(CMpkgID;4;4) != "CLNT" &
@Middle(CMpkgID;4;4) != "clnt" &
@Middle(CMpkgID;4;4) != "CONV" &
@Middle(CMpkgID;4;4) != "conv" &
@Middle(CMpkgID;4;4) != "MULT" &
@Middle(CMpkgID;4;4) != "mult" &
@Middle(CMpkgID;4;4) != "PAUT" &
@Middle(CMpkgID;4;4) != "paut" &
@Middle(CMpkgID;4;4) != "PBWR" &
@Middle(CMpkgID;4;4) != "pbwr" &
@Middle(CMpkgID;4;4) != "PROV" &
@Middle(CMpkgID;4;4) != "prov" &
@Middle(CMpkgID;4;4) != "WHSE" &
@Middle(CMpkgID;4;4) != "whse" &
@Middle(CMpkgID;4;4) != "THCL" &
@Middle(CMpkgID;4;4) != "thcl");
@Failure("Subsystem is Invalid - Please reenter a valid Subsystem.");
(@Middle(CMpkgID;11;4) != "CICS" &
@Middle(CMpkgID;11;4) != "BTCH" &
@Middle(CMpkgID;11;4) != "JOBS" &
@Middle(CMpkgID;11;4) != "cics" &
@Middle(CMpkgID;11;4) != "btch" &
@Middle(CMpkgID;11;4) != "jobs" &
@Middle(CMpkgID;11;4) != "EMED" &
@Middle(CMpkgID;11;4) != "emed" &
@Middle(CMpkgID;11;4) != "TKDW" &
@Middle(CMpkgID;11;4) != "tkdw" &
@Middle(CMpkgID;11;4) != "TKPS" &
@Middle(CMpkgID;11;4) != "tkps" &
@Middle(CMpkgID;11;4) != "TKPO" &
@Middle(CMpkgID;11;4) != "tkpo" &
@Middle(CMpkgID;11;4) != "OFLD" &
@Middle(CMpkgID;11;4) != "ofld" &
@Middle(CMpkgID;11;4) != "OJBM" &
@Middle(CMpkgID;11;4) != "ojbm" &
@Middle(CMpkgID;11;4) != "OARU" &
@Middle(CMpkgID;11;4) != "oaru" &
@Middle(CMpkgID;11;4) != "OFTP" &
@Middle(CMpkgID;11;4) != "oftp" &
@Middle(CMpkgID;11;4) != "CPYS" &
@Middle(CMpkgID;11;4) != "cpys" &
@Middle(CMpkgID;11;4) != "OPOS" &
@Middle(CMpkgID;11;4) != "opos");
@Failure("Package ID Suffix is Invalid - Please reenter valid pkg suffix.");
@IsNewDoc & !@IsError(@DbLookup("Notes":"NoCache";"";"CMxref";CMpkgID;"CMpkgID"));@Failure("Package ID Already exists.... Please reenter a unique Package ID.");
@Success)
0
Comment
Question by:pratigan
  • 8
  • 4
  • 2
  • +2
17 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8121420
Probably you are doing a save that refreshes the document again ? Check if you have someother validation somewhere on something else.

-Arun.
0
 
LVL 4

Author Comment

by:pratigan
ID: 8122191
HEllo Arun,
I am doing a refresh in the event Querysave and then again in Postsave.  Not sure why I had that in there... I'll have to test the logic to see why that was in there.
Thank you !
I'll let you know how I make out....
0
 
LVL 7

Expert Comment

by:scottrma
ID: 8122465
That's just what Notes does. First it displays whatever message you put in your @Failure() call, then it displays the "Notes error: field didn't pass validation formula" message and then it puts the focus (cursor) into the field that failed validation. This is normal behavior of Notes and there is nothing wrong about your formula if that is the only problem you're getting.

Regards,

Scott
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 63

Accepted Solution

by:
Zvonko earned 200 total points
ID: 8123229
Try this InputValidation formula:


Stage:=@Middle(CMpkgID;3;1);
Subsystem:=@UpperCase(@Middle(CMpkgID;4;4));
PackageIDSuffix:=@UpperCase(@Middle(CMpkgID;11;4));
@If(
CMpkgID = "";
  @Failure("Package ID is required.");
@IsNotMember("2":"3":"4";Stage);
  @Failure("Please reenter valid Stage i.e. 2,3 or 4. This Package Stage is Invalid: "+Stage);
@IsNotMember("REFR":"CLMS":"ECOM":"CLNT":"CONV":"MULT":"PAUT":"PBWR":"PROW":"WHSE":"THCL";Subsystem);
  @Failure("Please reenter a valid Subsystem. This Subsystem is Invalid: "+Subsystem);
@IsNotMember("CICS": "BTCH":"JOBS":"EMED":"TKDW":"TKPS":"TKPO":"OFLD":"OJBM": "OARU":"OFTP":"CPYS":"OPOS";PackageIDSuffix);
  @Failure("Please reenter valid pkg suffix. This Package ID Suffix is Invalid: "+PackageIDSuffix);
@IsNewDoc & !@IsError(@DbLookup("Notes":"NoCache";"";"CMxref";CMpkgID;"CMpkgID"));
  @Failure("Package ID Already exists.... Please reenter a unique Package ID.");
  @Success
)



Good luck,
Zvonko

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8127479
Alright guys!  Give some solution to Paul, and we will share the points.

:)
0
 
LVL 4

Author Comment

by:pratigan
ID: 8127811
Hello Zvonko,
Your validation formula is much more refined than mine was.  I am definitely going to be testing this way.  I will get back to you all soon with my test results.  Thank You much for your input.
:)
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8127853
Oh, you are welcome :-)

And keep some spare points for our joker :)

0
 
LVL 4

Author Comment

by:pratigan
ID: 8127893
HAHAHAHA... you got it !!
0
 
LVL 4

Author Comment

by:pratigan
ID: 8130358
Gentlemen,
The new formula form Zvonko works like a charm.  I am still getting the 2nd notes error pop up.  If this is true what scott says then there's nothing left to do but assign points..
0
 
LVL 13

Expert Comment

by:CRAK
ID: 8131395
Poor Arun.... you promised him.....
Well done Zvo! What a relief a simple @Uppercase can bring...  ;-))
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8132108
It is not for this 50 points, but now I am not sure.
I can remember the scenario like Scott tells, but in my test does this final error message not appear.

Perhaps it depends on your QuerySave code. I do not use any QuerySave code so this second message is not coming. I get only the appropriate @Failure message.

What is your QuerySave code?

0
 
LVL 7

Expert Comment

by:scottrma
ID: 8133211
I think perhaps it depends on your version of Notes. I know for sure that in R4 you get the 2nd popup, I think in R5 you don't, and I'm not sure about R6.

Regards,

Scott
0
 
LVL 4

Author Comment

by:pratigan
ID: 8135895
Hello Zvonko / Scott,
I am using R5, the querysave code performs a document refresh. looks like this.
Sub Querysave(Source As Notesuidocument, Continue As Variant)
     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument
     Set uidoc = workspace.CurrentDocument
     Call uidoc.Refresh
End Sub

I had to place this code to refresh the document befroe closing it in order to validate the fields on the form.  I had to remove auto refresh fields as that was killing the response time.  I also have this same refresh logic on the field just after the messages from the 2 fields, I have the refresh on entering the next field in order to validate the pkgid formulas.
Was not sure of any other way to do this without having the refreshes setup like that.
That's probably what's causing it. !?!?!?!
:-?
0
 
LVL 4

Author Comment

by:pratigan
ID: 8239941
Hello Gentlemen,
When I remove the queryclose refresh, I no longer get the 2nd message.  I will have to live with this as I need to have the queryclose refresh to resolve field populating formulas. I cannot use auto refresh fields as the form is large and alot of formulas that drag the response time dwn, that is why I placed the refresh in a queryclose event.  Thank you all for your help.

0
 
LVL 4

Author Comment

by:pratigan
ID: 8239948
Hello Zvonko,
I granted you the points, not just for the formula rewrite but also for a followup to the querysave.  
I know, I know Arun... you had input as well.. I will be posting a question for your points as well.
Thank You Much !!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8240736
Thanks for the points :-)

And please note that Arun is out of town for some while, but will be back in May.

0
 
LVL 4

Author Comment

by:pratigan
ID: 8242929
Ok.. Thank You for the update.  I have posted a question for him for his points.  Wouldn't want him to feel left out. You know him and his points. lol.
<:-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

615 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