Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



How do I Prompt a User for Data Entry at RunTime and Set Value to a Field

When running an Integra for Notes profile, there are times when you wish Integra to pop-up a dialog to allow entry of a value into a field, which data can then be either printed on the outputted Word document or Excel spreadsheet or used as part of some other calculation, formula or conditional test.

The @Prompt function will not work in such a situation and the solution to be used is the use of the InputBox method in Lotuscript which would be placed in the Advanced Tab of an Integra profile.

Define a field to be used for the storage of the value to be input by the user. Let us assume that the field is called DocRef. Create this field as a Computed Field in the Fields Tab of the Integra profile however do not define the value for the field. In fact the field can be set to be of type text in the Selected Fields List.

Below is an example of the Script Callback code that would be required in the Advanced Tab of an Integra profile to prompt a user to enter a value into a field called Docref. Note that the InputBox instruction defines the prompt for the window presented to the user as well as the window title and stores the data in a temporary variable called stats.uservar. The InputBox method does not provide any means through which data placed in stats.uservar can be validated or through which the format of the data can be defined at entry point. All data needs to be accepted into stats.uservar and then the contents of the DocRef field only set once validation has been successful.

stats is one of Integra's runtime objects derived from the StaticVars object class. It provides global information regarding the import or export process and it also includes the property uservar of type Variant, which can be utilised to store temporary information to be carried forward from event to event (execution of the Script Callback code). It is similar to the use of a variable declared as Static, however this type of declaration is not available for Lotus Script executed at runtime and therefore we have provided this property in which one can store any type of information needed throughout the import or export process.
Const CB_INITIALISE = 3
Const CB_BFORREADNOTES = 6
Const CB_BFORREADCOM = 7
Const CB_BFORWRITECOM = 1
Const CB_BFORWRITENOTES = 8
Const CB_BFORCOMACTION = 5
Const CB_BFORNOTESACTION = 2
Const CB_TERMINATE = 4

select case stats.cbstatus
case CB_INITIALISE
   ' temporarily disable the Integra progress bar
   If stats.pbar.enabled Then
      Call stats.pbar.DisableProgressBar()

      stats.uservar = inputbox("Please enter the controlled document reference","Document Printing","")

      ' Call stats.pbar.EnableProgressBar()    ' Integra for Notes 4.0
      Call stats.pbar.EnableProgressBar(False)   ' Integra for Notes 4.1
   else
      stats.uservar = inputbox("Please enter the controlled document reference","Document Printing","")
   end if

case CB_BFORREADNOTES
   stats.expdoc.docref = stats.uservar

case CB_BFORREADCOM
case CB_BFORWRITECOM
case CB_BFORWRITENOTES
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


.




FAQ# 0110
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024