Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



Creating additional fields on a document created using the Save As... options

Integra for Notes provides a facility to save the Excel, Word or PDF file created when processing an Integra profile into a Notes document as an attachment. This functionality is accessible through the Notes tab of the Integra profile.

In addition to allowing definition of the database into which the document is created and whether it is created as a new document, attached into an existing document or created as a response to the current document, the profile also allows certain fields to be updated with the evaluation of a formula. These fields are any chosen field defined as the field called "Subject Field" and any other field defined in the field called "Category Field."

However, the business need may require the updating of additional fields on the same document into which the Word, Excel or PDF file are being created beyond those exposed in the Notes tab of the Profile. This FAQ explains how these additional fields can be set on the profile.

To create additional fields one can use either the Formula or Script Callback found in the Advanced tab. Example code is found for both options below where the objective is to set the value of 3 fields, namely MyNewField1, MyNewField2 and MyNewField3 with the string "MyValue1", "MyValue2" and "MyValue3" respectively.

Example for creating additional fields using Formula Callback:

statlist := "CB_BFORWRITECOM":"CB_BFORNOTESACTION":"CB_INITIALISE":
            "CB_TERMINATE":"CB_BFORCOMACTION":"CB_BFORREADNOTES":
            "CB_NONE":"CB_NONE":"CB_AFTERWRITECOM":"CB_BFOREXPORT";
envstat  := @texttonumber(@environment("FormulaCbStatus"));
status   := @subset(@subset(statlist;envstat);-1);

@if(
    status="CB_INITIALISE";
        "";
    status="CB_BFOREXPORT";
        "";
    status="CB_BFORREADNOTES";
        "";
    status="CB_BFORWRITECOM";
        "";
    status="CB_AFTERWRITECOM";
        "";
    status="CB_BFORCOMACTION";
        "";
    status="CB_BFORNOTESACTION";
       @If(Form="Memo";"";

            @Do(
                @SetField("MyNewField_1";"MyValue_1");
                @SetField("MyNewField_2";"MyValue_2");
                @SetField("MyNewField_x";"MyValue_x")
            )
        );
    status="CB_TERMINATE";
        "";
    ""
   )

Example for creating additional fields using Script Callback:

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
case CB_AFTERWRITECOM
case CB_BFORCOMACTION
case CB_BFORNOTESACTION
   if not stats.savdoc is nothing then
       ' before save as...
       stats.savdoc.MyNewField_1 = "MyNewValue 1"
       stats.savdoc.MyNewField_2 = "MyNewValue 2"
       stats.savdoc.MyNewField_x = "MyNewValue x"
   else
       ' before send to
   end if
case CB_TERMINATE
end select

.




FAQ# 0176
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024