Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



How to set the subject and attachment name to values entered at runtime

When generating a Word, Excel or PDF file through an Integra export profile, Integra allows sending exported documents via e-mail or saving the file back into a chosen Lotus Notes database. You can set this up in the Notes Action tab of an Integra profile, which allows you to determine the subject and attachment name to be used.

The code below can be used to set the value of the Subject and Attachment Name fields based on values entered by the user at runtime or based on values found in the Notes document currently being processed. This code would need to be added into the Script Callback tab located in the Advanced tab of an Integra profile. The code wil need to be altered to use the appropriate field names.
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
case CB_BFORWRITECOM

    'Set values required in the CB_BFORNOTESACTION event
    stats.uservar = export.record.fvalue(0)

case CB_AFTERWRITECOM
case CB_BFORCOMACTION
case CB_BFORNOTESACTION

     'Set the fields mentioned below as required.
     'If the field values are the same for all processed documents, you can
     'place this code in the CB_BFOREXPORT event instead.
   
     'Subject Field
     struct.SaveSubFd = "Subject"                       

     'Subject Formula
     struct.SaveSubject = |"MySubject_| & stats.uservar & |"|

     'Attachment Name-Prefix Formula
     stats.AttName  = |"MyName_| & Second(Now()) & |_"|

   if not stats.savdoc is nothing then
       ' before save as...
   else
       ' before send to
   end if
case CB_TERMINATE
end select

.




FAQ# 0214
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024