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

Lotus Notes making a prompt in a fied

I have a dialoglist in a lotus form and it has 4 options, open,active,passive,closed

what i want to achieve is if passive is chosen, it will bring a prompt screen with yes no question asking if you want to get a mail sent or no?

if yes then it will send a mail ,if no it will not

how can i achieve it? if anythign other then passive is chosen it will not do anything??

i tried
(Kapalimi is the name of the field)

@If(Kapalimi="Passive";@Prompt([YesNo];"Mail";"Do you want to mail sent?");Kapalimi);

but i could not get it to work? :(((

appreciate for your help
  • 3
  • 3
2 Solutions
Sjef BosmanGroupware ConsultantCommented:
Where did you add the @If statement? The most logical place seems the PostSave, or the QueryClose...

When do you want to ask the user to send a mail: always when Kapalimi="Passive" ? Even when the document is reopened?
nicedoneAuthor Commented:
I put it to the

input translation and it worked !!

but now the problem is when the user hits yes to send email i want to get the date when it is hit to the yes button and i want to assign it to a field called kdate inside the form
i tried the formula below but could not achieve it how can i do it?

@If(Kapalimi="Pasif";x:=@Prompt([YesNo];"Mail";"Do you want to send email?");Kapalimi);
@If(x=1;@MailSend(email1;email2;email3;"Subject";"Email body";"";[IncludeDoclink]);Kapalimi);
@If(Kapalimi=1;FIELD kdate:="Pasif olarak degistirilme tarihi "+@Now;FIELD kdate:="");
Sjef BosmanGroupware ConsultantCommented:
It should not be in the input translation event, that doesn't seem the right place for it.

Put it in the QuerySave or in the PostSave. You might force a Save somewhere else, and then the code in the PostSave will automatically be executed. Anyway, if you want to use IncludeDocLink to mail a new document, the document must be saved beforehand.

Assuming you use the PostSave:

@If(Kapalimi!="Pasif"; @Return(""); "");
x:=@Prompt([YesNo];"Mail";"Do you want to send email?");
@If(x=1;@MailSend(email1;email2;email3;"Subject";"Email body";"";[IncludeDoclink]); "")

The field kdate should be a Computed field, with this formula:
@If(Kapalimi="Pasif"; "Pasif olarak degistirilme tarihi "+@Text(@Now); "")

You still have some more problems, e.g. what will you do when someone re-saves the document when Kapalimi="Pasif" ? Will you send another mail? Do you want kdate to be re-evaluated??
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

nicedoneAuthor Commented:
No if someone makes Pasif-->Pasif and saves i dont want it to be executed

also kdate should not be recalculated

only if it is Aktif-->Pasif then i should do that.

Do i have to use lotusscript then in PostSave right?

Can you help me with the code to achieve it?tnx
Sjef BosmanGroupware ConsultantCommented:
AFAIK, you can use formula in the PostSave event, although it might be easier to do in LotusScript. On the other hand, to send a mail from LS is more difficult...

Here's what you do in LotusScript:
- declare 2 global variables,
      Dim kapalimi As String
      Dim degist As Integer 'modified

- in the PostOpen:
      kapalimi= source.Document.GetItemValue("Kapalimi")(0) ' save current value

- in the QuerySave
      degist= kapalimi<>source.Document.GetItemValue("Kapalimi")(0) ' compare old and new value, true when changed

- in the PostSave
      If degist Then ' changed
      End If

You can do almost the same in Formula language. You need a computed-for-display field Degist to indicate a change, with this formula (might be too simple, has to be tested thoroughly):
      @If(@IsDocBeingSaved; @True; @False)
and a field OldKapalimi to store the old value, like this:
      @If(@IsDocBeingOpened | @IsDocBeingSaved; Kapalimi; OldKapalimi)
In the PostSave, you can have code like this:
      If(degist | OldKapalimi=Kapalimi; ""; @Return(""));
nicedoneAuthor Commented:
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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