This database provides a place from which organizations can manage their electronic approvals. Using the ApprovalLogic subform, a different form can be designed for each type of approval while all approval forms use the same approval logic. Consequently, when an organization changes its approval policies, only the ApprovalLogic subform will need to be changed, allowing for fast response to changing business needs.
Who will use this database?
Designers will derive several benefits from using this database:
They will not need to rewrite approval logic for each approval form because it is already provided in a subform
The approval logic provided on the subform is extremely flexible. Because all approval situations are not identical, the designer will fill out an application profile for each approval form, which tells the ApprovalLogic subform how this particular approval should be processed
When organizational approval policy changes, the designer does not need to change every form. Instead they can either edit the application profile documents or if necessary, they can modify the ApprovalLogic subform.
People who submit or approve electronic forms will benefit from the use of consistant methods.
When to use this database?
Use this database whenever you need electronic approval forms.
Where to find more information?
More information can be found in the Help Using document. Click the Instructions button on any view for help.
Access Control
Very Important:
Access level should be
Author
for all users of this database. This will prevent unauthorized editing or approval of documents within the database. The Author fields within the forms govern who will be able to edit/approve requests. Errors will occur if someone with Editor access attempts to approve a request when they are not an authorized approver of that document.
There are three steps to follow to use this application: (1) the designer creates one Application Profile document to define each type of approval that the workplace will need; (2) s/he creates one form for each application profile that has been defined; (3) the users create approval documents from those forms.
For Designers
Creating Electronic Approval Forms
1. Determine the first form that the workplace will need (e.g., Travel Authorization).
2. From the Application Profile view, click the Create Application Profile action. Fill out the profile completely; it will define how the approval cycle for this form will work.
Note:
Do not use
@Domain
when entering approver names. Any domain added will be stripped off and may cause complications when attempting to route a request.
Cursor down to the "Terminology" section. In the left column, notice terms such as "New", "Open", "Awaiting Approval", "Approved", etc. If your workplace uses different terminology (such as "Initiated" instead of "New"), replace the term in the right column with the one used by your workplace.
Save the new document.
4. Choose Create-->Design-->Form. Add the ApprovalLogic subform.
5. Choose Design-->Form Properties and give the form a name that is the (exact) same name as the type of approval in the Application Profile document (e.g., Travel Authorization).
6. In the Form Properties InfoBox, deselect "Include in [Create] Menu."
7. Add the fields you need for your type of approval (for example, a Travel Authorization only includes Travel related information) above or below the approval subform. You don't need to include any approval logic, since that is covered by the subform you added in step 2.
8. In the programmer's pane (the lower pane of the form design window), click on the arrow next to the word Define:
and select "(Form)".
This will provide a box where you can enter a window title. Enter an appropriate window title (e.g., "Travel Authorization").
9. Choose File-->Save to save your new form. Then choose File-->Close.
10. Repeat steps 2 - 9 for each form you need to create.
To create new requests, see the
Users
section below.
Processing Past Due Approvals
There is a scheduled agent in this template called "Process Past Due Approvals". This Agent will send a reminder to the approver if s/he misses the approval deadline. You must edit the Agent and set it up to run on your server.
1. Choose View-->Agents
2. Double-click on the Process Past Due Approvals agent
3. Click the Schedule button
4. Type the name of the server on which the agent should run.
For Users
Creating a Request for Approval
1. From the All Requests view or Next Approver view, click Create New Request.
2. Select the type of request that you want to create.
3. Click OK.
4. Fill out the document. If the application profile was set up to allow the user to edit the approver's name, you will see a button at the top of the document entitled "Edit Approver List". Click the button and enter an approver's name.
Note:
Do not use
@Domain
when entering approver names. Any domain added will be stripped off and may cause complications when attempting to route a request. Also, only enter Person-names as approvers. Group names are not supported.
5. Click Submit for Approval
Approving or Denying a Request
1. Review the document.
2. Click Approve or Deny.
3. If you are
prompted for comments, enter them in the dialog box and click OK. Notification will be sent to the appropriate person(s).
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$Info
$Body
'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Initialize
Declare Sub ApproveTheRequest(n)
Declare Sub SetNextApprover(n)
Declare Sub DenyTheRequest(n)
Declare Sub SetDueDate(n)
Declare Sub SendNotification(n)
'++LotusScript Development Environment:2:5:(Declarations):0:10
Dim s As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim note As NotesDocument
Dim maildoc As NotesDocument
Dim item As NotesItem
Dim rtitem As NotesRichTextItem
Dim documents As NotesDocumentCollection
Dim dtToday As NotesDateTime
Dim dtDue As NotesDateTime
Dim dtSet As NotesDateTime
Dim StatusList As Variant
Dim RoutingMethod As Variant
Dim LastApprover As Variant
Dim ApprName As Variant
Dim tmpList() As Variant
Dim MaxApprovers As Variant
Dim DueDate As Variant
Dim LateAction As Variant
Dim ApprStatus As Variant
'++LotusScript Development Environment:2:2:Initialize:1:10
What is the name of the form which requires approval (i.e., Purchase Requisition, Time Sheet...)?
Approval form name:
WorkflowObject
Is this a Serial (one at a time) or Parallel (all at once) route?
Routing type:
Serial
RoutingMethod
One after the other | SerialAll at Once | Parallel
When an someone needs to approve a form, they are sent an email. Should this email consist of a doclink to the original document which they must approve or should the entire document be sent?
Routing delivery:
Share
NotificationMethod
Doclink | Share
Approval List
Approver details
( must be filled in! )
What is the maximum number of individauals who will need to approve this form?
# of approvers:
MaximumApprovers
12345
'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Click(Source As Button)
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:BindEvents:1:129
Private Sub BindEvents(Byval Objectname_ As String)
Static Source As BUTTON
Set Source = Bind(Objectname_)
On Event Click From Source Call Click
End Sub
'++LotusScript Development Environment:2:2:Click:1:12
Sub Click(Source As Button)
On Error Goto ProcessError
tmpFunction = note.tmpFunction
If tmpFunction(0) = "" Then note.tmpFunction = "Manager"
Do you want each Approvers to have the option of entering comments?
Approvers enter comments:
CommentsAllowed
Yes | YesNo | No
Occasionally, a workflow becomes stalled and someone must resolve the problem then cause the flow to resume. This person is typically associated with the business group which requires the approval, such as Purchasing, Payroll, Human Resources, etc., and has the authority to take any action on the document. What person or group will perform this administrative function?
Form administrator:
FormAdmin
What text would you like to appear in the title bar of prompt boxes issued by this form?
Prompt caption:
PromptTitle
If this form will be emailed to another database once approval is complete, enter the Mail-in Database name here.
Mail-in database:
FinalDestinationDb
Terminology
What terminology does your workplace use for "New" (e.g., To Be Opened, Initiated, Latest, etc.)
What terminology does your workplace use for "Open" (e.g., Current, Valid, etc.)
Open
What terminology does your workplace use for "Awaiting Approval" (e.g., Unprocessed, To Be Done, etc.)
Awaiting Approval
What terminology does your workplace use for "Approved" (e.g., Signed, Passed, etc.)
Approved
What terminology does your workplace use for "Denied" (e.g., Not Approved, Approval Withheld, etc.)
Denied
What terminology does your workplace use for "Withdrawn" (e.g., Removed, Retracted, etc.)
Withdrawn
What terminology does your workplace use for "Closed" (e.g., Ended, Concluded, etc.)
Closed
What terminology does your workplace use for "Complete" (e.g., Concluded, Ended, etc.)
Complete
Awaiting Approval
Approved
Denied
Withdrawn
Closed
Complete
1S2R3S4R5S6R7S8R9S10R11S12R13S14R
StatusListj
There must be one status corresponding with each listed on the form.{
6S7S9S14SStatusList
Closer
0S0E
_Edit Document
Categori_ze
Send Docu_ment
_Forward
_Move to Folder...
_Remove from Folder
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$p_WorkflowObject_O
p_ApprovalWindow
p_MaximumApprovers
ApprovalDate1
ApprovalDate2
ApprovalDate3
ApprovalDate4
ApprovalDate5
FunctionPosition
ListElement1_1
ListElement1_2
ApprovalWindow
ListElement1
ListElement2
ListElement3
ListElement1_3
ListElement1_4
$dApprovalWindow_O
$dExpirationAction_O
dApprovalWindow
ApprovalWindow1
ApprovalWindow2
ApprovalWindow3
ApprovalWindow4
ApprovalWindow5
$dApprWindow_O
$dExpireAction_O
dApprWindow
dListElement1
dListElement2
dListElement3
dListElement4
dListElement5
ApprWindow1
ApprWindow2
ApprWindow4
ApprWindow5
ApprWindow3
$d_ApprWindow_O
$d_ExpireAction_O
d_ApprWindow
$d_ApproverSource_O
$ApprName1_O
d_ListElement1
ApprWin1
d_ListElement2
ApprWin2
d_ListElement3
ApprWin3
d_ListElement4
ApprWin4
d_ListElement5
ApprWin5
APPRWIN
$TITLE
$Info
$WindowTitle
$Script
$$Script_O
$$ScriptName
$$FormScript
$$$FormScript_O
$$WorkflowObject
$WorkflowObject_O
$$MaximumApprovers
$MaximumApprovers_O
$Body
$ACTIONS
(ApproverInfo)
tmpSource
Defined
ApprovalDoc
3S4S5S6S8S
@ @@ @` @
@@ @@@@@`@@
`@ `@@`@``@
tmpSource
ApprovalDoc
1S2S
Source of name:
If window is missed:
Approval window:
Approver function:
day(s)
tmpWin
Please enter an approval window.{
tmpWin
Approval window must be at least one day{
3S4S6S11StmpWin
tmpName
tmpName
tmpName
tmpSource
Defined
Please click the button to add the Approver's Name, or change the source.
3S4S5S6S7S8S10S18S
tmpFunction
Please enter the function of this approver (ex. Manager).
0R3S4S6S11StmpFunction
tmpSource
tmpSource
ApprovalDoc
tmpSource
Defined in this Profile | Defined
Entered on the form by the submitter | Entered
Retrieved from a database | Retrieved
3S4S6S8S9S10S11S12S
tmpLateAction
Approve the form | ApprovalReject the form | DenialSend a reminder | NotificationDo nothing | Nothing
tmpApproverLabel
tmpApproverLabel
Approver name:
tmpName
1S2S3S6S7S
@ @@ @` @
@@ @@@@@`@@
`@ `@@`@``@
ficationDo nothi
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
ApprWin1
$TITLE
$Info
$$ScriptName
tmpWin
$Body
(ApproverRetrievalInfo)
Source Db Server:
Element in List:
Source Doc Field:
Source Db View:
Manager
tmpSourceField
Please enter the the field name from which the data will be retrieved.{
3S4S6S11StmpSourceField
names.nsf
tmpSourcePath
Please enter the database path as directoryfilename.nsf.{
3S4S6S11StmpSourcePath
($Users)
tmpSourceView
Please enter the view from which the data will be retrieved.{
3S4S6S11StmpSourceView
tmpSourceServer
tmpListElement
If this field is a text list, please enter the element in the list. If it is not a text list, enter 1.
tmpListElementX
Please enter a number.{
3S4S6S11S19S24StmpListElement
tmpApproverLabel
tmpApproverLabel
Source Db Path:
Key Field:
RequesterName
tmpRetrievalKey
Please enter the name of the field on the approval form which will be used a a key to retrieve the data.{
3S4S6S11StmpRetrievalKey
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
r!,Hi
ueJ''
2vs]S
ApprWin1
tmpWin
$TITLE
$Info
$$ScriptName
$Body
Categori_ze
_Edit Document
Send Docu_ment
_Forward
Create New Request"
tList
ApplicationProfiles
1S2S6S8S10S
tList
Error
An error has occured. Please try again.
tList
0R1S2S9S15S17S21S
DocType
New Request
Choose one of the following:
0R1S2S3S7S9S11S13S
DocType
0R4S
when syncronous commands work, don't do ENVIRONMENT
0R1S
@V4Command([Compose]; DocType);
0R1S
FIELD WorkflowObject := DocType
0R1S
_Move to Folder...
_Remove from Folder...
Instructions
0S0E
O=Lotus Notes
O=Lotus Notes
PURSAFO
|.:#U
O=Lotus Notes
CN=Lotus Notes Template Development/O=Lotus Notes
PURSAFO
Fde!f^^
$Index
$Formula
$FormulaClass
$ViewFormat
$Comment
$ACTIONS
"MS Sans Serif
'++LotusScript Development Environment:2:5:(Options):0:74
Option Public
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub GetApproverNames(x)
Declare Sub IdentifyUser
Declare Sub SetNextApprover
Declare Sub SetDueDate
Declare Sub SendNotification
Declare Sub ResetAuthorNames
Declare Sub LoadDisplayFields
Declare Sub InitializeNewDoc
'++LotusScript Development Environment:2:5:(Declarations):0:10
'-----OBJECT VARIABLES-----
Dim w As NotesUIWorkspace
Dim doc As NotesUIDocument
Dim note As NotesDocument
Dim profile As NotesDocument
Dim maildoc As NotesDocument
Dim s As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim item As NotesItem
Dim dt As NotesDateTime
Dim db1 As NotesDatabase
Dim view1 As NotesView
Dim note1 As NotesDocument
'------DATA VARIABLES
Dim StatusList As Variant
Dim Status As Variant
Dim WorkflowObject As Variant
Dim PromptTitle As Variant
Dim MaxApprovers As Variant
Dim RoutingMethod As Variant
Dim DueDate As Variant
Dim ApprName As Variant
'------PROCESSING VARIABLES
Dim CurrentApprover As Variant
Dim NextAppr As Variant
Dim ApprovalCount As Variant
Dim NextApprover As Variant
Dim CurrentUser As String
Dim ApproverList() As Variant
Dim Action As Variant
Dim LastApprover As Integer
Dim DocWasSaved As Variant
Dim tmpList() As Variant
Dim tmpList1() As Variant
Dim SourceServer As Variant
Dim SourcePath As Variant
Dim SourceView As Variant
Dim SourceKey As Variant
Dim SourceField As Variant
Dim SourceElement As Variant
Dim PreviousDb As Variant
Dim PreviousView As Variant
Dim PreviousKey As Variant
'++LotusScript Development Environment:2:2:GetApproverNames:1:8
Sub GetApproverNames(x)
On Error Goto ProcessError
Print "GettingApproverNames"
KeyValue = note.GetItemValue(SourceKey(x))
ListElement = Cint(SourceElement(x)) - 1
'Do not get the input db, view, and note again unless it is different from the previous ones
If PreviousDb <> SourceServer(x) & SourcePath(x) Then
Set db1 = New NotesDatabase(SourceServer(x), SourcePath(x))
'If for some reason the database isn't found, post an error to user and abort
If (db1 Is Nothing) Then
Messagebox "Could not proceed, database not found. Please contact " + note.FormAdmin(0), 0 + 64, "Design Error"
doc.close
Print
End
End If
Set view1 = db1.GetView(SourceView(x))
'If for some reason the view isn't found, post an error to user and abort
If (view1 Is Nothing) Then
Messagebox "Could not proceed, view not found. Please contact " + note.FormAdmin(0), 0 + 64, "Design Error"
doc.close
Print
End
End If
Set note1 = view1.GetDocumentByKey(KeyValue(0),False)
'If for some reason the document isn't found, post an error to user and abort
If (note1 Is Nothing) Then
Messagebox "Could not proceed, document not found. Please contact " + note.FormAdmin(0), 0 + 64, "Design Error"
doc.close
Print
End
End If
Else
If PreviousView <> SourceView(x) Then
Set view1 = db1.GetView(SourceView(x))
'If for some reason the view isn't found, post an error to user and abort
If (view1 Is Nothing) Then
Messagebox "Could not proceed, view not found. Please contact " + note.FormAdmin(0), 0 + 64, "Design Error"
doc.close
Print
End
End If
Set note1 = view1.GetDocumentByKey(KeyValue(0),False)
'If for some reason the document isn't found, post an error to user and abort
If (note1 Is Nothing) Then
Messagebox "Could not proceed, document not found. Please contact " + note.FormAdmin(0), 0 + 64, "Design Error"
doc.close
Print
End
End If
Else
If PreviousKey <> SourceKey(x) Then Set note1 = view1.GetDocumentByKey(KeyValue(0),False)
'If for some reason the document isn't found, post an error to user and abort
If (note1 Is Nothing) Then
Messagebox "Could not proceed, document not found. Please contact " + note.FormAdmin(0), 0 + 64, "Design Error"
doc.close
Print
End
End If
End If
End If
'Get the name and put it in the appropriate ApprName field
If Not( note1.HasItem(SourceField(x))) Then
Messagebox "Could not proceed, field not found. Please contact " + note.FormAdmin(0), 0 + 64, "Design Error"