?
Solved

Simple Lotus If Statement

Posted on 2005-03-18
24
Medium Priority
?
304 Views
Last Modified: 2013-12-18
I'm relatively new to Lotus Notes, how do I write an if statement so that is one field equal y then the other field is populated by today's date?  I need to get this done immediately, so I assure you that I will give you 500 points and an A.
0
Comment
Question by:christie_holtz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
  • 7
24 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13574150
An IF in what language? Formula, LotusScript, Java or JavaScript?

Assuming Formula, and that otherfield is Computed, with value otherfield:
    @If(onefield="y"; @Setfield("otherfield"; Today); "")
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13574162
It depends on where and when you want set the value. So if you could give some additional info...
0
 

Author Comment

by:christie_holtz
ID: 13574222
There are two fields.  One is confirmed (which is a yes/no).  And the other is date confirmed.  I want date confirmed to automatically populate to be today's date.  I'm using Designer and am assuming that this goes as the default value for date confirmed?  Should it go somewhere else?
0
Independent Software Vendors: 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!

 

Author Comment

by:christie_holtz
ID: 13574326
I put this in the default value section for DateConfirmed.  there were no errors, but it did not work.  Do i put is somewhere else.  Possibly in the ZeroBundleConfirmed Section?
@If(ZeroBundleConfirmed="y"; @Setfield("DateConfirmed"; Today); "")
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 1200 total points
ID: 13574331
The default value for a field is used only when a new document is created. So if you want to set a field at a later stage, you need to set it differently. I assume you don't want users to manually change the date_confirmed field, so it should be a Computed field, with a value like this:
    @If(confirmed="y" & !IsTime(date_confirmed); @Today; date_confirmed)

Which means: if the value of the field 'confirmed' is 'y' and the field date_confirmed (i.e. this field) is not a time value, then use the current date, else replace this field with this field.

And sorry, I had a typo in my first post: it should be @Today, it's a function in Formula language.
0
 

Author Comment

by:christie_holtz
ID: 13574348
I'm getting an error when i put in @If(ZeroBundleConfirmed="y" & !IsTime(dateconfirmed); @Today; dateconfirmed)

It says @FunctionOperator expected  or @ Function does not require argument : ')'
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13574414
Triple @%$#%! Another typo (it's not my day), also IsTime is a Formula function, it should be @IsTime...
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13574730
@If(ZeroBundleConfirmed="y"; @today;DateConfirmed)

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13575023
Hey Partha! Go to work, bro.

Not good anyway, because if one saves the document a second time, the DateConfirmed will be overwritten.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13575043
HI Bro

Thx for the advice :), It all depends on whether the field is computed for display or composed and his logic though !

partha

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13575060
Do we agree that we disagree? ;)
0
 

Author Comment

by:christie_holtz
ID: 13575351
Ok..I did this and it worked : @If(ZeroBundleConfirmed="Yes"; @Today; DateConfirmed)

However, now I have to update an agent.  The code is as below

FIELD ZeroBundleConfirmed := ZeroBundleConfirmed;
@If(Except="Yes";@Prompt([Ok];"Error";"This Bundle can not be confirmed because the 'Does an exception need to be filed for this bundle?' field equals Yes.");@SetField("ZeroBundleConfirmed"; "Yes"));SELECT @All

I want to updated the DateConfirmed equal to today's date when the ZeroBundleConfirmed is set to yes.  

0
 

Author Comment

by:christie_holtz
ID: 13575353
Again, I vow 500 points and an A
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13575424
@If(ZeroBundleConfirmed="Yes"; @Today; DateConfirmed), this line does that only

Partha
0
 
LVL 14

Accepted Solution

by:
p_partha earned 800 total points
ID: 13575428
give like htis:

field dateconfirmed:=@If(ZeroBundleConfirmed="Yes"; @Today; DateConfirmed);dateconfirmed
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13575520
Don't forget to check if the document was already confirmed, with the code above you will overwrite the original confirmation date! That's why I used @IsTime
0
 

Author Comment

by:christie_holtz
ID: 13575534
So i can just put the field statement at the beginning?
0
 

Author Comment

by:christie_holtz
ID: 13575543
Since you both are being so helpful, i'll post this question again and ask one of you to respond with the same answer.  that way I  can give you both 500 points and an A.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13575557
You can split the points,
As sjef was first, please give him take the lion's share

Partha
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13575564
typo "As sjef was first, please give him the lion's share " 

:)

Partha
0
 

Author Comment

by:christie_holtz
ID: 13575572
I'll do whatever makes ya'll happy.  You've both been so helpful I just wanted to make sure you both got a bunch of points.
0
 

Author Comment

by:christie_holtz
ID: 13575649
Any thoughts on the agent?
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13575673
THe line i gave :
field dateconfirmed:=@If(ZeroBundleConfirmed="Yes"; @Today; DateConfirmed);

can  be added in the agent only

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13581998
Thanks! :) And don't forget to protect DateConfirmed against overwriting (e.g. using the @IsTime function)...
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 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