Link to home
Start Free TrialLog in
Avatar of pratigan
pratiganFlag for United States of America

asked on

receiving a notes error upon field validation completed

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)
Avatar of Arunkumar
Arunkumar

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

-Arun.
Avatar of pratigan

ASKER

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....
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
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alright guys!  Give some solution to Paul, and we will share the points.

:)
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.
:)
Oh, you are welcome :-)

And keep some spare points for our joker :)

HAHAHAHA... you got it !!
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..
Poor Arun.... you promised him.....
Well done Zvo! What a relief a simple @Uppercase can bring...  ;-))
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?

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
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. !?!?!?!
:-?
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.

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 !!
Thanks for the points :-)

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

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.
<:-)