Yes/No Answer directing flow direction of Work/Emails

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.

JaziarAsked:
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.

JaziarAuthor Commented:
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) )
      Else
            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.document.save(True,True)
      Call uidoc.reload()
      Exit Sub
jaziar:
      Msgbox "Error occurred on line number " & Erl & " error is " & Error
      Exit Sub
End Sub
0
HemanthaKumarCommented:
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


~Hemanth
0
p_parthaCommented:
Jaziar
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&, _
      "Continue?")

if answer%=6 then
set maildoc = db.createdocument
maildoc.form="memo"
maildoc.subject = "approval needed from manager"
maildoc.sendto="<yourmanagername>"
maildoc.subject="your first subject"
maildoc.send false
else
set maildoc = db.createdocument
maildoc.form="memo"
maildoc.subject = "Project team"
maildoc.sendto="<your project team members>"
maildoc.subject="your second subject subject"
maildoc.send false
end if
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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

Thanks for the quick input
0
Andrea ErcolinoCommented:
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";

@If(  
      choice2 = @Yes; @Do(
            @MailSend( managerSendTo; ""; ""; managerSubjectYes; managerMessageYes; "" );
            @MailSend( teamSendTo; ""; ""; teamSubjectYes; teamMessageYes; "" )
      );
      choice2 = @No; @Do(
            @MailSend( managerSendTo; ""; ""; managerSubjectNo; managerMessageNo; "" );
            @MailSend( teamSendTo; ""; ""; teamSubjectNo; teamMessageNo; "" )
      );
      ""
)
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
p_parthaCommented:
Raputa
It's time to sleep too late for you :)

partha
0
Andrea ErcolinoCommented:
it's true... here is 22:25... and for you?
0
p_parthaCommented:
am in D.C...

Partha
0
Andrea ErcolinoCommented:
D.C. = District of Columbia?
0
JaziarAuthor Commented:
Been out of office.  I am back today and working on the problem.
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.