?
Solved

Validation and Save button -easy

Posted on 2006-05-19
15
Medium Priority
?
197 Views
Last Modified: 2013-12-18
I have several fields with validation (LN 6) and a button Save.  Once saved I need to send an e-mail message.

How do I stop sending the message if any of the validations failed?

Thanks!!!
0
Comment
Question by:Zopilote
  • 6
  • 5
  • 3
14 Comments
 
LVL 18

Accepted Solution

by:
marilyng earned 200 total points
ID: 16722789
ON the save button:

@if(!@isValid;@Return("");"");
@if(@Command([FileSave]);@Do(
---your do stuff---);"")

That kinda what you were looking for?
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 100 total points
ID: 16723842
How about just putting the @MailSend in the PostSave?
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16724425
Ho, ho.. that too!  We need a question listing obvious notes solutions... along with a big hand that reaches out and slaps you a few times because you didn't think of it.
0
Technology Partners: 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!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16724508
You remember the times there was no QueryRecalc? Another one of those ah-that's-what-it's-for events. Ever used it?
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16724537
Not yet, but there were a bunch of R5 apps that I could have used this in. :)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16725836
I suggested it once on Notes.Net I think. I p-ed me off that I had to do a PostRecalc twice (the second one triggered by a NotesTimer I think) to get a computed list of choices  for a keywords field (set to Refresh choices on form refresh). The choices depended on some other field on the form, and for some reason the thing could only be solved in LotusScript. But PostRecalc is too late, because the keywords field reads the new choices during the recalc. It was making me mad!

Found it, it's one of the earliest references I can find:
    http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/5770b0dde647b4e2852568780036e525?OpenDocument

Hm, this guy had the same problem, months earlier: :-(
    http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/a5d48df9c7523a67852568890034d45d?OpenDocument
0
 
LVL 5

Author Comment

by:Zopilote
ID: 16726312
Marilyng, that's perfect! many thanks!  With just @if(!@isValid;@Return("");""); worked perfect.

sjef_bosman, nice suggestion! beautiful and clear! unfortunately it does not work in my case, I have two buttons, one 'Save & e-mail' and another 'Save only', but many thanks indeed!

0
 
LVL 5

Author Comment

by:Zopilote
ID: 16726318
Oh no! the split did not work the way I wanted!!!
The ACCEPTED ANSWER is MARILYNG and the ASSISTED ANSWER is SJEF_BOSMAN!
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16726325
I'm surprised you could split with 50 points.. oh, I see you upped it to 75.  I left a message in Community Service. :)  Glad it worked.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16727695
Ah, you should have said that you have two buttons! Guessing is not my strongest point ;)

Not for the points, but I'd use a different method: a global variable (in LotusScript) called tobemailed, the Save-button sets tobemailed to False and saves the document, the  Save&Send-button sets tobemailed to True, and the PostSave-event does "if tobemailed then mail the document" and it sets tobemailed to False.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16728307
Good thing  Zopilote is not you!    Tell me, do you practice disagreeing?  
0
 
LVL 5

Author Comment

by:Zopilote
ID: 16728787
I will try again!!
sjef_bosman, interesting suggestion, but I only have one button with the possibility to send the e-mail after saving successfully, therefore IMHO the flag is redundant in my case. Thanks anyway!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16733943
Disagreeing? Is that very painful? Then the answer would be no.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16738948
Kidding... Zopilote, sjef was offering a second suggestion in case mine was inappropriate for your needs.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

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

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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

612 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