Article Details
Id:10546
Product:finPOWER Connect
Type:NEW
Version:1.06.04
Opened:18/09/2012
Closed:27/09/2012
Released:24/10/2012
Job: J010399

Creating a Document via the User Interface now makes a 'Source' object available to the 'AfterParamatersInitialise' and 'AfterParametersFinalise' Script events

Creating a Document via the User Interface now makes a 'Source' object available to the 'AfterParamatersInitialise' and 'AfterParametersFinalise' Script events, e.g., when creating an Account Document, the 'source' parameter of the Script will be a finAccount object.

The following forms now support this:

  • Create Account Document
  • Create Client Document
  • Create User Document

The following sample Script shows how to default Document Parameters from the Source object (assumes an 'Account' Document with a custom Text parameter named 'Salutation'):

' Handle Events
Select Case eventId
  Case "AfterParametersInitialise"
    If TypeOf source Is finAccount Then
      With DirectCast(source, finAccount)
        parameters.SetString("Salutation", .Clients(0).SalutationResolved)
      End With
    End If
End Select

NOTE: Since this document could be generated from different locations, e.g., via the Report Explorer or when creating a Workflow Document from the Task Manager, we must check that the 'source' parameter is of the expected type.