• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Validation and Save button -easy

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
Zopilote
Asked:
Zopilote
  • 6
  • 5
  • 3
2 Solutions
 
marilyngCommented:
ON the save button:

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

That kinda what you were looking for?
0
 
Sjef BosmanGroupware ConsultantCommented:
How about just putting the @MailSend in the PostSave?
0
 
marilyngCommented:
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Sjef BosmanGroupware ConsultantCommented:
You remember the times there was no QueryRecalc? Another one of those ah-that's-what-it's-for events. Ever used it?
0
 
marilyngCommented:
Not yet, but there were a bunch of R5 apps that I could have used this in. :)
0
 
Sjef BosmanGroupware ConsultantCommented:
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
 
ZopiloteAuthor Commented:
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
 
ZopiloteAuthor Commented:
Oh no! the split did not work the way I wanted!!!
The ACCEPTED ANSWER is MARILYNG and the ASSISTED ANSWER is SJEF_BOSMAN!
0
 
marilyngCommented:
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
 
Sjef BosmanGroupware ConsultantCommented:
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
 
marilyngCommented:
Good thing  Zopilote is not you!    Tell me, do you practice disagreeing?  
0
 
ZopiloteAuthor Commented:
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
 
Sjef BosmanGroupware ConsultantCommented:
Disagreeing? Is that very painful? Then the answer would be no.
0
 
marilyngCommented:
Kidding... Zopilote, sjef was offering a second suggestion in case mine was inappropriate for your needs.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 6
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now