[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Yes/No Answer directing flow direction of Work/Emails

Posted on 2004-11-18
10
Medium Priority
?
514 Views
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.

0
Comment
Question by:Jaziar
  • 3
  • 3
  • 3
  • +1
10 Comments
 

Author Comment

by:Jaziar
ID: 12618525
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
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12618773
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
 
LVL 14

Assisted Solution

by:p_partha
p_partha earned 800 total points
ID: 12618803
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Jaziar
ID: 12618830
It is late in the day here - I will try this first thing in the morning

Thanks for the quick input
0
 
LVL 3

Accepted Solution

by:
Andrea Ercolino earned 1200 total points
ID: 12619059
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
 
LVL 14

Expert Comment

by:p_partha
ID: 12619068
Raputa
It's time to sleep too late for you :)

partha
0
 
LVL 3

Expert Comment

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

Expert Comment

by:p_partha
ID: 12619361
am in D.C...

Partha
0
 
LVL 3

Expert Comment

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

Author Comment

by:Jaziar
ID: 12665076
Been out of office.  I am back today and working on the problem.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

830 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