This database provides an 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).
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
'++LotusScript Development Environment:2:5:(Options):0:74
Option Public
'++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
maildoc.FlowStatus = "Please follow this doclink to the " & WorkflowObject(0) & " and either approve or deny it."
End If
On Error Resume Next
'Send it, attaching the form if NotificationMethod = "Send"
NotificationMethod = note.NotificationMethod
Select Case NotificationMethod(0)
Case "Send"
note.SendTo = SendTo
note.Subject = Subject
note.save True, True
Call note.Send (True)
Case "Share"
'Put a doclink in the Body field and populate the other fields on the Bookmark mail form
Call rtitem.AppendDocLink(note, "DocLink to " & WorkflowObject(0))
maildoc.InheritedDbTitle = db.Title
maildoc.Form = "Bookmark"
maildoc.SendTo = SendTo
maildoc.Subject = Subject
Call maildoc.Send (False)
End Select
End Sub
+d }8
+d }8
+d }8
Lotus Notes
PURSAF
Debbie2 Branco
F)`b"
0|wm-
PURSAF
TS3+v
$TITLE
$AssistType
$AssistLastRun
$AssistDocCount
$Comment
$AssistFlags
$AssistInfo
$AssistQuery
$AssistAction
$AssistAction_Ex
$UpdatedBy
$Flags
(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
Application Profile
Times New Roman
'++LotusScript Development Environment:2:5:(Options):0:66
Option Public
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub GetApproverDetails(i As Integer)
'++LotusScript Development Environment:2:5:(Declarations):0:10
Dim w As NotesUIWorkspace
Dim doc As NotesUIDocument
Dim note As NotesDocument
Dim SourceList() As Variant
Dim NameList() As Variant
Dim EditApprList() As Variant
Dim FunctionList() As Variant
Dim WinList() As Variant
Dim LateActionList() As Variant
Dim SourceServerList() As Variant
Dim SourcePathList() As Variant
Dim SourceViewList() As Variant
Dim SourceFieldList() As Variant
Dim ListElementList() As Variant
Dim RetrievalKeyList() As Variant
Dim ListMax As Integer
Dim DocWasSaved As Variant
'++LotusScript Development Environment:2:2:GetApproverDetails:1:8
Sub GetApproverDetails(i As Integer)
'Fields which begin with d_ will become temporary fields in the approval document.
'They will be deleted in that doc's QueryClose event.
'Fields which begin with tmp are temporary to the profile doc and are deleted on its QueryClose.
'All other fields are copied directly to the Approval doc.
Editable = note.EditableList
MaxApprovers = note.MaximumApprovers
'Subtract 1 to make it zero based
ListMax = Cint(MaxApprovers(0)) - 1
'Populate ApproverLabel (for use in the dialog boxes)
note.tmpApproverLabel = "Approver" & Str(i + 1)
'Redefine size of array to equal MaxApprovers
Redim SourceList(ListMax)
Redim NameList(ListMax)
Redim EditApprList(ListMax)
Redim FunctionList(ListMax)
Redim WinList(ListMax)
Redim LateActionList(ListMax)
'Retrieve existing field values
ApprSource = note.d_ApprSource
ApprName = note.d_ApprName
ApprFunction = note.d_ApprFunction
ApprWin = note.ApprWin
LateAction = note.d_LateAction
EditAppr = note.EditAppr
For a = 0 To Ubound(EditAppr)
EditApprList(a) = EditAppr(a)
Next
'Populate arrays with the values - we use a holding array instead of the retrieved variant array because
'the ubound of the retrieved variant array is likely to increase (up to MaxApprovers) and it was not defined
'as a dynamic array
For y = 0 To ListMax
If Ubound(ApprSource) >= y Then SourceList(y) = ApprSource(y)
If Ubound(ApprName) >= y Then NameList(y) = ApprName(y)
If Ubound(ApprFunction) >= y Then FunctionList(y) = ApprFunction(y)
If Ubound(ApprWin) >= y Then WinList(y) = ApprWin(y)
If Ubound(LateAction) >= y Then LateActionList(y) = LateAction(y)
Next
'Populate defaults
If SourceList(i) = "" Then
If i = 0 Then
note.tmpSource = "Defined"
note.tmpName = ""
note.tmpFunction = "Manager"
note.tmpWin = 5
note.tmpLateAction = "Notification"
Else
note.tmpSource = SourceList(i-1)
note.tmpName = ""
note.tmpFunction = FunctionList(i-1)
note.tmpWin = WinList(i-1)
note.tmpLateAction = LateActionList(i-1)
End If
Else
note.tmpSource = SourceList(i)
If Not ( (NameList(i) = "Entered when submitted") Or (NameList(i) = "Retrieved from database") ) Then
note.tmpName = NameList(i)
Else
note.tmpName = ""
End If
note.tmpFunction = FunctionList(i)
note.tmpWin = WinList(i)
note.tmpLateAction = LateActionList(i)
End If
doc.reload
'Display Dialog box
If w.DialogBox("(ApproverInfo)", True, True) = False Then Exit Sub
'Add retrieved values to lists
tmpSource = note.tmpSource
SourceList(i) = tmpSource(0)
Select Case SourceList(i)
Case "Entered"
NameList(i) = "Entered when submitted"
EditApprList(i) = Cstr(i + 1)
Case "Retrieved"
NameList(i) = "Retrieved from database"
EditApprList(i) = ""
Case Else
tmpName = Evaluate("@Name([CN]; tmpName)", note)
NameList(i) = tmpName(0)
If Editable(0) = "Yes" Then
EditApprList(i) = Cstr(i + 1)
Else
EditApprList(i) = ""
End If
End Select
tmpFunction = note.tmpFunction
FunctionList(i) = tmpFunction(0)
tmpWin = note.tmpWin
WinList(i) = tmpWin(0)
tmpLateAction = note.tmpLateAction
LateActionList(i) = tmpLateAction(0)
'Assign list arrays back to the note fields
note.d_ApprSource = SourceList
note.d_ApprName = NameList
note.EditAppr = EditApprList
note.d_ApprFunction = FunctionList
note.ApprWin = WinList
note.d_LateAction = LateActionList
'If source = Retrieved then check where retrieved from
Redim SourceServerList(ListMax)
Redim SourcePathList(ListMax)
Redim SourceViewList(ListMax)
Redim SourceFieldList(ListMax)
Redim ListElementList(ListMax)
Redim RetrievalKeyList(ListMax)
SourceServer = note.d_SourceServer
SourcePath = note.d_SourcePath
SourceView = note.d_SourceView
SourceField = note.d_SourceField
ListElement = note.d_ListElement
RetrievalKey = note.d_RetrievalKey
For y = 0 To ListMax
If Ubound(SourceServer) >= y Then SourceServerList(y) = SourceServer(y)
If Ubound(SourcePath) >= y Then SourcePathList(y) = SourcePath(y)
If Ubound(SourceView) >= y Then SourceViewList(y) = SourceView(y)
If Ubound(SourceField) >= y Then SourceFieldList(y) = SourceField(y)
If Ubound(ListElement) >= y Then ListElementList(y) = ListElement(y)
If Ubound(RetrievalKey) >= y Then RetrievalKeyList(y) = RetrievalKey(y)
Next
tmpSource = note.tmpSource
If tmpSource(0) = "Retrieved" Then
If SourcePathList(i) = "" Then
If (i = 0) Or (SourcePathList(0) = "") Then
note.tmpSourceServer = ""
note.tmpSourcePath = "names.nsf"
note.tmpSourceView = "($Users)"
note.tmpSourceField = "Manager"
note.tmpListElement = "1"
note.tmpRetrievalKey = "RequesterName"
Else
note.tmpSourceServer = SourceServerList(i-1)
note.tmpSourcePath = SourcePathList(i-1)
note.tmpSourceView = SourceViewList(i-1)
note.tmpSourceField = SourceFieldList(i-1)
note.tmpListElement = ListElementList(i-1)
note.tmpRetrievalKey = RetrievalKeyList(i-1)
End If
Else
note.tmpSourceServer = SourceServerList(i)
note.tmpSourcePath = SourcePathList(i)
note.tmpSourceView = SourceViewList(i)
note.tmpSourceField = SourceFieldList(i)
note.tmpListElement = ListElementList(i)
note.tmpRetrievalKey = RetrievalKeyList(i)
End If
doc.reload
If w.DialogBox("(ApproverRetrievalInfo)", True, True) = True Then
tmpSourceServer = note.tmpSourceServer
SourceServerList(i) = tmpSourceServer(0)
tmpSourcePath = note.tmpSourcePath
SourcePathList(i) = tmpSourcePath(0)
tmpSourceView = note.tmpSourceView
SourceViewList(i) = tmpSourceView(0)
tmpSourceField = note.tmpSourceField
SourceFieldList(i) = tmpSourceField(0)
tmpListElement = note.tmpListElement
ListElementList(i) = tmpListElement(0)
tmpRetrievalKey = note.tmpRetrievalKey
RetrievalKeyList(i) = tmpRetrievalKey(0)
End If
Else
SourceServerList(i) = ""
SourcePathList(i) = ""
SourceViewList(i) = ""
SourceFieldList(i) = ""
ListElementList(i) = ""
RetrievalKeyList(i) = ""
End If
note.d_SourceServer = SourceServerList
note.d_SourcePath = SourcePathList
note.d_SourceView = SourceViewList
note.d_SourceField = SourceFieldList
note.d_ListElement = ListElementList
note.d_RetrievalKey = RetrievalKeyList
doc.reload
If doc.EditMode Then doc.refresh
End Sub
D D H
T T x x
4 4 0
-T #8
tmpName
ApplicationProfile'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Postopen(Source As Notesuidocument)
Declare Sub Postmodechange(Source As Notesuidocument)
Declare Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Declare Sub Querysave(Source As Notesuidocument, Continue As Variant)
'++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 NOTESUIDOCUMENT
Set Source = Bind(Objectname_)
On Event Postopen From Source Call Postopen
On Event Postmodechange From Source Call Postmodechange
On Event Queryclose From Source Call Queryclose
On Event Querysave From Source Call Querysave
End Sub
'++LotusScript Development Environment:2:2:Postopen:1:12
Sub Postopen(Source As Notesuidocument)
Set w = New NotesUIWorkspace
Set doc = source
Set note = source.Document
If Not(doc.EditMode) Then note.SaveOptions = "0"
doc.AutoReload = False
DocWasSaved = False
End Sub
'++LotusScript Development Environment:2:2:Postmodechange:1:12
Sub Postmodechange(Source As Notesuidocument)
If doc.EditMode Then
note.SaveOptions = "1"
doc.reload
End If
End Sub
'++LotusScript Development Environment:2:2:Queryclose:1:12
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
If DocWasSaved = False Then Exit Sub
ItemList = note.Items
Forall n In ItemList
If Ucase(Left(n.Name, 3)) = "TMP" Then n.Remove
End Forall
note.Save True, True
End Sub
'++LotusScript Development Environment:2:2:Querysave:1:12
Sub Querysave(Source As Notesuidocument, Continue As Variant)
MaxApprovers = note.MaximumApprovers
If MaxApprovers(0) = "" Then
Messagebox "What is the maximum number of approvers for this type of approval?", 0,_
"Required Field"
source.GoToField("MaximumApprovers")
continue = False
Exit Sub
End If
ApprName = note.d_ApprName
If Ubound(ApprName) < Cint(MaxApprovers(0)) - 1 Then
Messagebox "You must specify approver details for " & MaxApprovers(0) & " approvers or change the value of # of approvers.", 0, "Application Profile"
continue = False
Else
DocWasSaved = True
End If
End Sub
Application Profile
Basics
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
New Button
Need a newer version of Notes to execute this button.
Do you want each Approvers to have the option of entering comments?
Approvers enter comments:
CommentsAllowed
YesNo
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
Close
0S0E
_Edit Document
Categori_ze
Send Docu_ment
_Forward
_Move to Folder...
_Remove from Folder
(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
03/19/96 09:11:58 AM Lotus Notes updated [OtherDomainServers]