hcl-bot
January 31, 2008, 10:20pm
1
i want to geT the sum of two numbers from fields example when i input a number from field1 and field2 i want the sum of field 1 and field2 from field3
example
field1 = 2
field2 = 5
field3 = 7
using lotus script,formula,javascript or java
like this thanks
hcl-bot
January 31, 2008, 10:40pm
2
Subject: sum of two numbers
In field3, put formula:
@Sum (field1:field2)
If you want to ensure they are nubmers.
f1:=@TextToNumber(field1);
f2:=@TextToNumber(field2);
@Sum (f1:f2)
hcl-bot
February 1, 2008, 12:17am
3
Subject: RE: sum of two numbers
where i can paste this code form field3, field2 or field1 i encounter an error
f1:=@TextToNumber(field1);
f2:=@TextToNumber(field2);
@Sum (f1:f2)
thanks
hcl-bot
February 1, 2008, 12:25am
4
Subject: RE: sum of two numbers
Use @ToNumber instead of @TextToNumber . The code goes in Field3 (the sum field). And if you’re not going to do anything else to educate yourself, at least read the “Application Design” section of Domino Designer Help. Put some effort into it – we all have.
hcl-bot
February 1, 2008, 12:30am
5
Subject: RE: sum of two numbers
thanks stan rogers for the code
hcl-bot
February 1, 2008, 12:41am
6
Subject: sum of two numbers
thanks to all people who help how to solve my problem thanks regards
hcl-bot
January 31, 2008, 10:36pm
7
Subject: sum of two numbers
What are you trying to do? In what context.
For example it could be done in the background:
doc.field3(0) = doc.field1(0) + doc.field2(0)
But if you’re dealing with the document in the front end then…
uidoc.fieldSetText(“field3”. Cstr(
Cint(uidoc.fieldgetText(“field1”)) +
Cint(uidoc.fieldgetText(“field2”))
))
You could do all this in a dialog box where two numbers are entered and upon closing the dialogbox the fields are summed.
Of course this also could be done using @functions , and lotus script is not required. The hard part is getting things to refresh.
Remember Lotus Notes is NOT an Excel spreadsheet.
hcl-bot
January 31, 2008, 10:55pm
8
Subject: RE: sum of two numbers
uidoc.fieldSetText(“field3”. Cstr(Cint(uidoc.fieldgetText(“field1”)) +
Cint(uidoc.fieldgetText(“field2”))
))
i have a problem of this code