|
Setting up and using custom dialogs
Custom dialogs can be created and selected in the Custom Dialog field found in the Word/Excel tab of the Integra profile.
The following steps must be performed in order to create and use custom dialogs:
- Open the Integra database in Domino Designer and add a new subform.
- Create the required fields (e.g. Dialog_CompanyName, Dialog_DateFrom and Dialog_DateTo)
- Save the subform and name it '_Dialog_any name'' (e.g. _Dialog_TSStatement)
- Open the Integra database in the Notes client
- Run the Integra maintenance process from the Actions Menu - Administration\Integra Maintenance (you require the [Admin] user role to be able to run this process) so that the list of available custom dialogs are refreshed.
- Edit the Integra profile which is going to make use of this custom dialog, go to the Word/Excel tab and select the dialog in the Custom Dialog field.
- Place the code below into the Advanced Script Callback tab of the Integra profile and amend it as required.
- Save and close the Integra profile
Const CB_INITIALISE = 3
Const CB_ACTIONONLY = 16
Const CB_BFOREXPORT = 10
Const CB_INVALID = 12
Const CB_CATEGORY = 13
Const CB_TOTAL = 14
Const CB_CONFLICT = 15
Const CB_BFORREADNOTES = 6
Const CB_BFORWRITECOM = 1
Const CB_AFTERWRITECOM = 9
Const CB_BFORCOMACTION = 5
Const CB_BFORNOTESACTION = 2
Const CB_TERMINATE = 4
dim dtfrom As String
dim dtto As String
dim dtjob As String
select case stats.cbstatus
case CB_INITIALISE
dim doc As NotesDocument
' Get a handle to the user's profile which contains the fields
' found in the custom dialog
set doc = GetUserProfile()
Redim stats.uservar(2)
' Read values entered in the dialog box
stats.uservar(0) = Trim(doc.Dialog_CompanyName(0))
stats.uservar(1) = doc.Dialog_DateFrom(0)
stats.uservar(2) = doc.Dialog_DateTo(0)
' Exit if the company name is found to be blank
if Trim(doc.Dialog_CompanyName(0)) = "" then
export.continue = false
end if
case CB_ACTIONONLY
case CB_BFOREXPORT
case CB_INVALID
case CB_CATEGORY
case CB_TOTAL
case CB_CONFLICT
case CB_BFORREADNOTES
' Here, the documents are filtered according to the
' values entered in the custom dialog
' Read the job date from document being processed
dtjob = Format(stats.expdoc.DateJob(0),"yyyymmdd")
' Read 'from' and 'to' dates from stats.uservar
dtfrom = Format(stats.uservar(1),"yyyymmdd")
dtto = Format(stats.uservar(2),"yyyymmdd")
' Check whether doc matches criteria entered in the custom dialog
If Not Trim(Ucase(stats.expdoc.CompanyName(0))) = Ucase(stats.uservar(0)) Then
export.continue = False
Elseif (dtjob >= dtfrom) And (dtjob <= dtto) Then
' Validation passed
Else
export.continue = False
End If
case CB_BFORWRITECOM
case CB_AFTERWRITECOM
case CB_BFORCOMACTION
case CB_BFORNOTESACTION
if not stats.savdoc is nothing then
' before save as...
else
' before send to
end if
case CB_TERMINATE
end select
|
. |