Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



Using Integra's CustomCode script library

Integra provides a Script Library called "CustomCode". The library is blank and can be used to add any customized code to the Integra database. Whatever subs, functions or LSXs are included into this library will be instantly available for use in the Integra Callback Script. That means that the CustomCode library is loaded with every execution of an Integra profile. This makes Integra highly customizable, however, there is one thing to keep in mind when adding code to the CustomCode library:

A very important point is that customised code must not contain any declarations of Notes UI back-end classes, for instance NotesUIWorkspace. If any of the Notes UI classes are declared in the CustomCode library (or in any other included library), the scheduled agent functionality will stop working. It does not matter whether a particular function that contains such a declaration is not called in any of the scheduled profiles. Just the existence of such a declaration anywhere within the code is enough to produce this effect. This is a limitation of all Domino server releases prior to 5.0.8.

The recommanded method of adding code to the CustomCode library is as following:
  • Create your own new script library and give it a name in the format IntegraCustom4xxx, whereas xxx should be your organisations or domain name (this way you will not run into naming problems with any library we may create in the future). All your code goes in here.
  • In the existing CustomCode script library simply add one line of code in the Declaration section:
    Use "IntegraCustom4xxx"
  • Cut and paste any code you have placed in any of your Integra profile's Advanced Callback Script field into a new function or procedure in your IntegraCustom4xxx script library.
  • We recommand that you again use a naming convention for your function and procedures to not get in conflict with any of the functions and procedures used in the other Integra script libraries. For instance you can add your organisations name or domain name as a prefix to all functions and procedures.
  • Do NOT use the Option Public statement in the Options section of your IntegraCustom4xxx script library as you might create conflicts with existing public variable declarations of Integra. Instead make those functions or procedures public that you want to call from within the Advanced Callback Script field.
  • Each function or procedure called from the Advanced Callback Script field requires two parameters (see example code)

The following is an example of a custom script library:

Option Declare

Public Sub xxx_AdvancedCallbackExampleSub(stats As Variant, export As Variant)
    Const CB_INITIALISE = 3
    Const CB_BFOREXPORT = 10
    Const CB_BFORREADNOTES = 6
    Const CB_BFORWRITECOM = 1
    Const CB_AFTERWRITECOM = 9
    Const CB_BFORCOMACTION = 5
    Const CB_BFORNOTESACTION = 2
    Const CB_TERMINATE = 4

    select case stats.cbstatus
    case CB_INITIALISE
    case CB_BFOREXPORT
    case CB_BFORREADNOTES
      Call AddTempFieldToNotesDoc(stats,export)
    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
End Sub

Sub AddTempFieldToNotesDoc(stats As Variant, export As Variant)
    stats.expdoc.TempField = Now()
End Sub

The function/procedure is called from the Advanced Callback Script field as following:

Call xxx_AdvancedCallbackExampleSub(stats, export)

.




FAQ# 0049
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024