continue = false in Formula language

Hi there!

I'm currently getting into the Formula language of Lotus Notes (6.5) and I was wandering if it's possible to stop the QuerySave from saving your document if an error occurs.

In LotusScript, you can use continue = false, but how can I achieve this in Formula Language?

Thanks in advance!
LVL 5
prohacxAsked:
Who is Participating?
 
HemanthaKumarConnect With a Mentor Commented:
In formula language.. you can't

sjef, @Return also will not work by then the doc is saved and there is no special instruction to notes to stop save as that in LS. @Return just stops executing any code beyond the point..

~Hemanth
0
 
qwaleteeConnect With a Mentor Commented:
No such thing.  The way to do it in formula is to use a validation formula that fails (but there's no way to fail silenty)
0
 
Sjef BosmanGroupware ConsultantCommented:
In a field validation, you would use @Failure("text").

You could try two things (haven't tested this myself...):
- @Return(@False)
- @Return(@Failure("text"))

Otherwise, I wouldn't know. Why is it that you don't want to save but couldn't find the error earlier? Usually, field validation will solve it all... You can even validate the whole form in one field validation.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Sjef BosmanGroupware ConsultantCommented:
Just tested my ideas. Don't work. :(
Would have been nice though...
0
 
HemanthaKumarCommented:
Don't worry R7 might comeup with something like that.
0
 
Sjef BosmanConnect With a Mentor Groupware ConsultantCommented:
That soon?! Thought it was scheduled for R8 CF28...

Validation formulae @Failure will work anyway.
0
 
prohacxAuthor Commented:
Hi there again!

What I did was add a hidden field on the form and in the input validation event I added this:

R := @DbLookup("":"NoCache"; @DbName; "WEBPAGES"; WebpageName;1);

@If(      @IsNewDoc & !@IsError(R);
                  @failure("A page with this name (" + WebpaginaBenaming + ") already exists. Please choose another name.");
                  @Success
)

Seems to work, thanks guys!!!

0
 
Sjef BosmanGroupware ConsultantCommented:
If you put this in your field WebpageName instead, the cursor will be in the field when validation fails.

And your validation formula isn't correct, you'll find out soon enough. But that's another question...
0
 
prohacxAuthor Commented:
Well, it works O.K. for me...
0
 
Sjef BosmanGroupware ConsultantCommented:
But, will it continue to work OK for you...
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.

All Courses

From novice to tech pro — start learning today.