' SummaryText_Client_Example
Option Explicit On
 
Public Function Main(ByVal source As Object, ByVal target As iseSummaryTextTarget, ByVal contextData1 As Object, ByVal contextData2 As Object, ByRef text As String) As Boolean
 
Dim Client As finClient
 
  ' Initialise
  Client = DirectCast(source, finClient)
 
  ' Set Summary Text (enclosing text in a <title> tag allows the Title as well as the Summary Text to be set)
  Select Case CStr(contextData1)
    Case "Loaded"
      text = "<title><b>Client " & Client.ClientId & "; " & Client.Name & "</title>"
      text &= Client.ClientTypeId & ", " & finBL.ClientTypes(Client.ClientTypeId).Description
      
    Case "Add"
      text = "<title><b>Clients</title>"
      text &= "<b><color=Red>You are adding a new Client"
      
    Case "Edit"
      text = "<title><b>Client " & Client.ClientId & "; " & Client.Name & "</title>"
      text &= "<b><color=Red>You are editing this Client"
      
    Case Else
      text = "<title><b>Clients</title>"
  End Select
 
  Return True
 
End Function