Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

Validate richtxtfield in querysave
Nadeem Shaikh 26.Mar.03 07:28 PM a Web browser
Domino Designer -- LotusScript 4.6.4 Windows NT

Hi,

i need to resolve the following problem..can someone please help...

i have a button on a form whic has the following formula:

FIELD SaveCheck := "OK";
TErrNo := ErrorNo;
TenvVar := @Environment("DocIsSaved");
@Do(@Command([FileSave]));
@If(TenvVar = "1";
@Do(@PostedCommand([OpenView]; "(AllErrors)"; TErrNo);
@PostedCommand([Compose]; ""; "Error Notice");
@PostedCommand([ViewRefreshFields]);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow]);
@PostedCommand([FileCloseWindow]);
@PostedCommand([FileCloseWindow]));
@Prompt([OK];"Document was not saved";"Document was not saved Validation Failed."))

now when the first @command(filesave) (ie.@Do(@Command(filesave) above) is triggered..it runs the querysave event of the form..which has the following code:

Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim session As New NotesSession

On Error Goto Errsub
Call session.SetEnvironmentVar( "DocIsSaved", "0" )
Call source.GoToField("ErrorScreenshot")
Call source.selectall
Call source.copy
Call source.deselectall
Goto OkExit
OkExit:
Call session.SetEnvironmentVar( "DocIsSaved", "1" )
Exit Sub
ErrSub:
If Err = 4407 Then
continue = False
Msgbox "You must enter a screenshot of the issue",48,"Error"
Call session.SetEnvironmentVar( "DocIsSaved", "0" )
End If
Resume OkExit

End Sub


the querysave event is not supposed to mail users and save the form if the richtextfield "ErrorScreenshot" is blank..but it seems to do it anyway..
i was assuming that when it does the call source.deselect it runs the goto errsub, which then brings up the messagebox "You must enter a screenshot of the issue".

Basically, i am trying to validate whether the richtextfield "ErrorScreenshot" is empty or not..if it is then it should not save the form but bring up an error message notifying the user that they must complete the richtextfield.

I understand i could use valuelength item property to check if the richtextfield is empty or not..how would i introduce that in my code...

can someone please tell me where i am going wrong or what is the best way to validate richtextfields in notes v4.6

Thanks

Nadeem Shaikh




Validate richtxtfield in querysave (Nadeem Shaikh 26.Mar.03)
. . RE: Validate richtxtfield in querys... (Stan Rogers 26.Mar.03)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow