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

Display informational message

I have placed an edit on a specific field and have a prompt that tests for the value in that field and displays a warning message if the value is over 100, but allows it, so the user just clicks ok and moves on.  The problem is the message box keeps appearing for every field they tab to.  This is because the form has auto refresh fields turned on.  How do I have this message only appear once upon the initial field change. ??
0
pratigan
Asked:
pratigan
  • 7
  • 7
  • 2
1 Solution
 
zvonkoCommented:
Hello Paul,

you need one more field to save the former value.

For example if your field name is: Hight
then create one more field: OldHight
In Hight field InputTranslation formula use at least this code:
FIELD Hight:=Hight;
FIELD OldHight:=OldHight;
@If(Hight=OldHight;@Return(Hight);"");
@SetField("OldHight";Hight);
@If(@TextToNumber(@Text(Hight))>100;@Prompt([OK];"Hight";"Hight:"+@Text(Hight));"");
Hight

The last line is the returned field value. Also the value inside the @Return() function. Be aware of this.

Good luck,
zvonko

0
 
ArunkumarCommented:
Zvo Dont complicate !  Its not that complicated !

:-)
Please check out our question i will be posting an interesting request in 10 mins !  thanks buddy!
0
 
pratiganAuthor Commented:
Zvonko,
I will attempt what you gave me.  Also Arun, Please let me know when you have posted your interesting request to review.
Thanks !!
Paul
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
pratiganAuthor Commented:
Sub Exiting(Source As Field)
     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument
     Set uidoc = workspace.CurrentDocument
     If uidoc.currentfield > 100 Then
          Messagebox "You have entered a Value Greater Than 100 !",,"WARNING !"
     End If
End Sub

I have coded this script under the exiting class, however the if does not test for the current field value.  I have reviewed Zvonko's recommendation and I will be trying that next...
0
 
zvonkoCommented:
Arun is right :)
It works much easier.

Put this into onBlur event of the Field:
if (this.value > 100) alert("You have entered a Value Greater Than 100!")

Cheers,
zvonko

0
 
pratiganAuthor Commented:
I have applied Zvonko's recommendations and it works perfect.  I would like to see Arun's interesting request first before closing this quesiton out.
Thanks to both of you for your continued support and feedback.  It is well appreciated.
%:)
0
 
pratiganAuthor Commented:
zvonko,
I jst got your message about the onblur.   I will try that as well.  I'll let you know.
Thanks !!
0
 
zvonkoCommented:
which one was the right one: second field or onBlur?

0
 
zvonkoCommented:
we are to fast for EE :)

0
 
pratiganAuthor Commented:
HAHA.... definitely too fast for EE.
Both solutions worked great.  Therefore I'm faced with a dilemma.  You both gave me correct solutions.  Therefore, I'll both of you decide whom gets the points.  :))
0
 
zvonkoCommented:
If Arun does not complicate now he can get the points :)

This is the way I would like to have EE: collaborate is the key!

<|:-)

0
 
zvonkoCommented:
Paul, only for your LotusScript code here:
The property uidoc.currentfield returns only the field name.
Even worser: in exiting event it does not return the name of actual field but the name of the field containing the curser after exiting actual field.
To get field value you have to use:
myString = uidoc.FieldGetText( "myFieldName" )

You see?

0
 
pratiganAuthor Commented:
ello Zvonko,
I understand what you are saying.  Thank You for the clarification.  I will grant the points to Arun.  Thank You !!
0
 
pratiganAuthor Commented:
Arun / Zvonko,
Thank You both for your valued solutions.  Both solutions worked great.  Your both a very valueable resource to me and I appreciate your feedback always !!  Thank Again !!
Paul

I have added the actual onBlur solution here for any followup reference that someone my want upon review of the answer.
 if (this.value > 100) alert(" WARNING ! - You have entered a Value Greater Than 100!")
0
 
zvonkoCommented:
You are welcome :-)

0
 
ArunkumarCommented:
Boyz.... Boyz..... !!!
Please...this is more embarrassing for me...

Zvo !
You are Genius in everything....

For pratigan...here is the link for the new interesting request....
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=lotusnotes&qid=20296038

Hop over it guys!
-Arun
0

Featured Post

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!

  • 7
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now