Lotus Notes making a prompt in a fied

Posted on 2012-08-27
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
Question by:nicedone
    LVL 46

    Expert Comment

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

    Author Comment

    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:="");
    LVL 46

    Assisted Solution

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

    Author Comment

    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
    LVL 46

    Accepted Solution

    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(""));

    Author Closing Comment


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
      In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now