?
Solved

Lotus Notes making a prompt in a fied

Posted on 2012-08-27
6
Medium Priority
?
781 Views
Last Modified: 2013-12-18
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
0
Comment
Question by:nicedone
  • 3
  • 3
6 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 38336186
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?
0
 

Author Comment

by:nicedone
ID: 38336335
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;"Pasif";"Aktif");
@If(Kapalimi=1;FIELD kdate:="Pasif olarak degistirilme tarihi "+@Now;FIELD kdate:="");
@PostedCommand([FileSave])
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 2000 total points
ID: 38336590
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??
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:nicedone
ID: 38336702
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
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 38336947
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(""));
      @MailSend...
0
 

Author Closing Comment

by:nicedone
ID: 38340984
tnx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

840 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