Yes/No Answer directing flow direction of Work/Emails

Posted on 2004-11-18
Last Modified: 2013-12-18
How would you go about this.

When a form is opened there is a visible Submit Release action button.

When the button is pushed the following actions should take place.

Question to user - Is this for Project A or Project B? - that value will then populate a computed field on the form called CodeType (this can happen after the form or dialog box closes)

Question to user - Does this need approved by managment? - Yes or No

if yes a email is sent out to a manager - this email subject and message is differnt is no is selected.
if no a email is sent to a project team telling them they have work to do.  this email subject and message is differnt if yes is selected.

I have used Dialog boxes to get comments from users, but never yes or no questions with more than one question.  So I am thinking LotusScript with a form created with the 2 questions.  But I am not sure how to get the value from the form and then seperate the emails depending on the value.

Is LotusScript the best way to do this?  If so could someone so my a sample on how to split the emails depending on the value of a field.

Question by:Jaziar

    Author Comment

    Here is some LotusScript I have used in another form, if it makes it easier to use this as a sample

    Sub Click(Source As Button)
          On Error Goto jaziar
          Dim session As New NotesSession
          Dim uiDoc As notesUiDocument
          Dim doc As NotesDocument, dialog As NotesDocument
          Dim ws As New NotesUIWorkspace
          Dim s As New NotesSession
          Dim db As NotesDatabase
          Set db = session.CUrrentDatabase
          Set dialog = db.CreateDocument
          Set uiDoc = ws.currentDocument    
          flag = ws.DialogBox( "Comm", 1,1, 0, 0, 0, 0, "Comment", dialog)
          If Not flag Then Exit Sub
          Dim comment As String
          Dim recipient As Variant    
          comment = dialog.NoEmailComment(0)
          Set uidoc = ws.currentDocument
          Dim Discussion As String
          Dim history As NotesItem
          Set history = uidoc.document.getfirstitem( "Discussion" )
          If history Is Nothing Then
                Set history = uidoc.document.replaceitemvalue( "Discussion" , Now & " From " & s.commonuserName & Chr$(13) )
                history.AppendToTextList Now & " From " & s.commonuserName & Chr$(13)
          End If
          history.AppendToTextList "------------------------------------------------------" & Chr$(13)
          history.AppendToTextList COMMENT & Chr$(13)
          history.AppendToTextList "======================================================" & Chr$(13)
    ' save it in the backend, but update changes
          Call uidoc.reload()
          Exit Sub
          Msgbox "Error occurred on line number " & Erl & " error is " & Error
          Exit Sub
    End Sub
    LVL 24

    Expert Comment

    LS is the option to go..

    Create the form and call it using dialogbox function.. this will return the data back to the form (depends on Update flag and new field flag) and depending on the field value you can perform the action

    LVL 14

    Assisted Solution

    Somethign like this:

    In global options put this :

    %INCLUDE "lsconst.lss"

          Dim boxType As Long, answer As Integer
          boxType& = MB_YESNO + MB_ICONQUESTION
          answer% = Messagebox("Does this needs to be approved by management?", boxType&, _

    if answer%=6 then
    set maildoc = db.createdocument
    maildoc.subject = "approval needed from manager"
    maildoc.subject="your first subject"
    maildoc.send false
    set maildoc = db.createdocument
    maildoc.subject = "Project team"
    maildoc.sendto="<your project team members>"
    maildoc.subject="your second subject subject"
    maildoc.send false
    end if

    Author Comment

    It is late in the day here - I will try this first thing in the morning

    Thanks for the quick input
    LVL 3

    Accepted Solution

    put the following action in your button:

    choice1 := @Prompt( [OkCancelList]; "Submit Release (step 1/2)"; "What project?"; ""; "Project A":"Project B" );
    @If( choice1 = ""; @Return( "" ); "" );
    choice2 := @Prompt( [YesNoCancel]; "Submit Release (step 2/2)"; "Need management approval?" );
    @If( choice2 = -1; @Return( "" ); "" );

    managerSendTo := "fill here";
    managerSubjectYes := "fill here";
    managerSubjectNo := "fill here";
    managerMessageYes := "fill here";
    managerMessageNo := "fill here";

    teamSendTo := "fill here";
    teamSubjectYes := "fill here";
    teamSubjectNo := "fill here";
    teamMessageYes := "fill here";
    teamMessageNo := "fill here";

          choice2 = @Yes; @Do(
                @MailSend( managerSendTo; ""; ""; managerSubjectYes; managerMessageYes; "" );
                @MailSend( teamSendTo; ""; ""; teamSubjectYes; teamMessageYes; "" )
          choice2 = @No; @Do(
                @MailSend( managerSendTo; ""; ""; managerSubjectNo; managerMessageNo; "" );
                @MailSend( teamSendTo; ""; ""; teamSubjectNo; teamMessageNo; "" )
    LVL 14

    Expert Comment

    It's time to sleep too late for you :)

    LVL 3

    Expert Comment

    by:Andrea Ercolino
    it's true... here is 22:25... and for you?
    LVL 14

    Expert Comment

    am in D.C...

    LVL 3

    Expert Comment

    by:Andrea Ercolino
    D.C. = District of Columbia?

    Author Comment

    Been out of office.  I am back today and working on the problem.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
    This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 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

    18 Experts available now in Live!

    Get 1:1 Help Now