Simple Lotus If Statement

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.
christie_holtzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sjef BosmanGroupware ConsultantCommented:
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
Sjef BosmanGroupware ConsultantCommented:
It depends on where and when you want set the value. So if you could give some additional info...
0
christie_holtzAuthor Commented:
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

christie_holtzAuthor Commented:
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
Sjef BosmanGroupware ConsultantCommented:
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
christie_holtzAuthor Commented:
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
Sjef BosmanGroupware ConsultantCommented:
Triple @%$#%! Another typo (it's not my day), also IsTime is a Formula function, it should be @IsTime...
0
p_parthaCommented:
@If(ZeroBundleConfirmed="y"; @today;DateConfirmed)

Partha
0
Sjef BosmanGroupware ConsultantCommented:
Hey Partha! Go to work, bro.

Not good anyway, because if one saves the document a second time, the DateConfirmed will be overwritten.
0
p_parthaCommented:
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
Sjef BosmanGroupware ConsultantCommented:
Do we agree that we disagree? ;)
0
christie_holtzAuthor Commented:
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
christie_holtzAuthor Commented:
Again, I vow 500 points and an A
0
p_parthaCommented:
@If(ZeroBundleConfirmed="Yes"; @Today; DateConfirmed), this line does that only

Partha
0
p_parthaCommented:
give like htis:

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sjef BosmanGroupware ConsultantCommented:
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
christie_holtzAuthor Commented:
So i can just put the field statement at the beginning?
0
christie_holtzAuthor Commented:
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
p_parthaCommented:
You can split the points,
As sjef was first, please give him take the lion's share

Partha
0
p_parthaCommented:
typo "As sjef was first, please give him the lion's share " 

:)

Partha
0
christie_holtzAuthor Commented:
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
christie_holtzAuthor Commented:
Any thoughts on the agent?
0
p_parthaCommented:
THe line i gave :
field dateconfirmed:=@If(ZeroBundleConfirmed="Yes"; @Today; DateConfirmed);

can  be added in the agent only

Partha
0
Sjef BosmanGroupware ConsultantCommented:
Thanks! :) And don't forget to protect DateConfirmed against overwriting (e.g. using the @IsTime function)...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

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.