<?xml version="1.0" encoding="utf-8"?>
  <finScript version="1.00" exportedUtcDate="2024-09-18T01:48:46.0000000">
    <CreatedUserId>ADMIN</CreatedUserId>
    <CreatedUtcDate>2024-09-18T01:44:23.3670000</CreatedUtcDate>
    <UpdatedUserId>ADMIN</UpdatedUserId>
    <UpdatedUtcDate>2024-09-18T01:47:43.0810000</UpdatedUtcDate>
    <ScriptId>HWIBSBAE</ScriptId>
    <Description>illion BankStatements Bank Account Enquiry</Description>
    <ScriptType>HtmlWidget</ScriptType>
    <Active>true</Active>
    <AllowUI>false</AllowUI>
    <Bookmarks />
    <Category />
    <Code>' HtmlWidget_illion_BankStatements
Option Explicit On
Option Strict On

' ####################################################################
' illion BankStatements Bank Account Enquiry wizard HTML Widget
'
' Copyright (C) Intersoft Systems Limited 2022
'
' Version: 1.12 (18/09/2024)
'
' Usage: System-supplied HTML Widget
' #################################################################
' Version        Date  User     Job       Description
' -------  ----------  -------  --------  -------------------------
'    1.08  12/07/2022  ISS      J028905   Show readonly cost centre information
'    1.09  22/07/2022  ISS      J026867   Implement supported products
'    1.10  08/11/2022  ISS      J029594   Add BrokerFlow
'    1.11  27/03/2024  ISS      J033191   Updated PerformEnquiry
'    1.12  18/09/2024  ISS      J029950   Changed the Workflow Executor to the finBL.HtmlWidgetUtilities.WorkflowItemComplete function
' #################################################################

' Constants
Private Const PRODUCT_ID As String = "CREATE REQUEST"
Private Const PRODUCT_ID_BROKERFLOW As String = "BROKERFLOW"
Private Const FORM_KEY As String = "BankAccountEnquiry_BankStatements"
Private Const SERVICE_ID As String = "BankStatements"
'Private Const SUPPORTED_PRODUCTS As String = ""

' Common Parameters
Private mAccountAppId As String
Private mAccountAppApplicantPk As Integer
Private mBranchId As String
Private mClientId As String
Private mWorkflowPk As Integer
Private mWorkflowItemPk As Integer

' Objects
Private mCombinedParameters As ISKeyValueList
Private mParameters As ISKeyValueList
Private mStartupParameters As ISKeyValueList

Public Function Main(eventId As String,
                     parametersJson As String,
                     startUpParametersJson As String,
                     hostingContext As isefinHtmlWidgetHostingContext,
                     requestInfo As finScriptRequestInfo,
                     ByRef returnValue As String) As Boolean

  ' Assume Success
  Main = True

  ' Get Parameters
  mParameters = finBL.CreateKeyValueList()
  mParameters.FromSimpleJsonString(parametersJson)
  mStartupParameters = finBL.CreateKeyValueList()
  mStartupParameters.FromSimpleJsonString(startUpParametersJson)

  ' Get Combined Parameters (Startup Parameters updated with event Parameters)
  mCombinedParameters = mStartupParameters.Clone()
  mCombinedParameters.UpdateFromKeyValueList(mParameters, True)

  ' Get Common Parameters
  With mCombinedParameters
    mAccountAppId = .GetString("AccountAppId")
    mAccountAppApplicantPk = .GetInteger("AccountAppApplicantPk")
    mBranchId = .GetString("BranchId")
    mClientId = .GetString("ClientId")
    mWorkflowPk = .GetInteger("WorkflowPk")
    mWorkflowItemPk = .GetInteger("WorkflowItemPk")
  End With

  ' Handle Events
  Select Case eventId
    Case ""
      ' Main event, i.e., return initial HTML content (excluding html and body tags)
      returnValue = ScriptInfo.TemplateText

    Case "GetInitialisationInfo"
      ' Get Initialisation Information required for this wizard
      Main = GetInitialisationInfo(returnValue)

    Case "GetServiceReport"
      ' Get Service Report
      Main = GetServiceReport(parametersJson, returnValue)

    Case "PerformEnquiry"
      ' Perform Enquiry
      Main = PerformEnquiry(parametersJson, returnValue)

    Case "WizardValidate"
      ' Validate wizard page
      Main = WizardValidate(parametersJson, returnValue)

    Case Else
      finBL.Error.ErrorBeginFormat("Unhandled event '{0}'.", eventId)
      Main = False
  End Select

End Function

''' &lt;summary&gt;
'''  Get Initialisation Information required for this wizard
''' &lt;/summary&gt;
Public Function GetInitialisationInfo(ByRef response As String) As Boolean

  Dim AccountApp As finAccountApp
  Dim AccountAppApplicant As finAccountAppApplicant
  Dim BranchRO As finBranchRO
  Dim Client As finClient
  Dim FormInitialisationInfo As FormInitialisationInfo
  Dim Success As Boolean
  Dim CostCentreResolved_IllionBankStatements As finCostCentreResolved_IllionBankStatements

  ' Assume Success
  Success = True

  ' Validate
  If Len(mClientId) = 0 AndAlso mAccountAppApplicantPk = 0 Then
    Success = False
    finBL.Error.ErrorBegin("Client Id or Account Application Applicant details not specified.")
  ElseIf Len(mClientId) = 0 AndAlso mAccountAppApplicantPk &lt;&gt; 0 AndAlso Len(mAccountAppId) = 0 Then
    Success = False
    finBL.Error.ErrorBegin("Account Application must also be specified.")
  ElseIf Len(mClientId) &lt;&gt; 0 AndAlso finBL.CurrentUserInformation.IsClientFilteredOut(mClientId) Then
    Success = False
    finBL.Error.ErrorBegin("You do not have permission to view this Client.")
  ElseIf Len(mAccountAppId) &lt;&gt; 0 AndAlso finBL.CurrentUserInformation.IsAccountAppFilteredOut(mAccountAppId) Then
    Success = False
    finBL.Error.ErrorBegin("You do not have permission to view this Account Application.")
  ElseIf finBL.Database.IsReadOnly Then
    Success = False
    finBL.Error.ErrorBegin("Access denied. Database is Read-Only.")
  ElseIf mWorkflowPk = 0 AndAlso mWorkflowItemPk &lt;&gt; 0 Then
    Success = False
    finBL.Error.ErrorBegin("You must also specify the WorkflowPk if a Workflow Item has been specified.")
  ElseIf mWorkflowPk &lt;&gt; 0 AndAlso mWorkflowItemPk = 0 Then
    Success = False
    finBL.Error.ErrorBegin("You must also specify the WorkflowItemPk of the Workflow Item to Action if a Workflow has been specified.")
  End If

  ' Get Client or Applicant objects
  If Success Then
    Success = GetClientOrApplicant(Client, AccountApp, AccountAppApplicant)
  End If

  ' Get Initialisation Info
  If Success Then
    FormInitialisationInfo = New FormInitialisationInfo()

    ' Other Properties
    With FormInitialisationInfo
      ' General
      If Client IsNot Nothing Then
        .ClientId = Client.ClientId
        .ClientName = Client.Name
      End If
      If accountApp IsNot Nothing Then
        .AccountAppId = AccountApp.AccountAppId
        .AccountAppName = AccountApp.Name
        .AccountAppApplicantPk = AccountAppApplicant.Pk
        .AccountAppApplicantName = AccountAppApplicant.Name
      End If
      .WorkflowPk = mWorkflowPk

      ' Branch
      .BranchId = mBranchId
      If Len(.BranchId) = 0 AndAlso AccountApp IsNot Nothing Then .BranchId = AccountApp.BranchId
      If Len(.BranchId) = 0 AndAlso Client IsNot Nothing Then .BranchId = Client.BranchId

      ' Lists
      For Each BranchRO In finBL.Branches
        .Branches.Add(New BranchInfo(BranchRO, SERVICE_ID))
      Next

      ' Get Cost Centre Defaults for Equifax
      CostCentreResolved_IllionBankStatements = finBL.CostCentresResolved.ItemByBranchId(.BranchId).IllionBankStatements

      ' Cost Centre Defaults
      .OverrideExportDayCount = CostCentreResolved_IllionBankStatements.BankAccountEnquiryOverrideExportDayCount
      .DefaultExportDayCount = CostCentreResolved_IllionBankStatements.BankAccountEnquiryExportDayCount
      .EnableBrokerFlow = CostCentreResolved_IllionBankStatements.BankAccountEnquiryEnableBrokerFlow

      ' Configuration
      .AllowBranch = Len(mBranchId) &lt;&gt; 0
      .ShowBranch = finBL.Settings.AddOns.CostCentre
      .ServiceName = finBL.CreditBureau.GetServiceName(SERVICE_ID)
      .TestMode = finBL.SettingsUser.CostCentreTestModeResolved
    End With
  End If

  ' Response
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(FormInitialisationInfo, response)
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Create Context Data for Scripts
''' &lt;/summary&gt;
Private Function CreateScriptContextData() As ISKeyValueList

  Return finBL.HtmlWidgetUtilities.CreateScriptContextData(ScriptInfo, FORM_KEY)

End Function

''' &lt;summary&gt;
'''  Get a finClient and, optionally, a finAccountAppApplicant object from Web Service properties
''' &lt;/summary&gt;
''' &lt;returns&gt;
'''  A Boolean value indicating success
''' &lt;/returns&gt;
Private Function GetClientOrApplicant(ByRef client As finClient,
                                      ByRef accountApp As finAccountApp,
                                      ByRef accountAppApplicant As finAccountAppApplicant) As Boolean

  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Initialise ByRef Parameters
  client = Nothing
  accountApp = Nothing
  accountAppApplicant = Nothing

  ' Initialise
  If Len(mClientId) = 0 Then
    ' Applicant
    accountApp = finBL.CreateAccountApp()
    If accountApp.Load(mAccountAppId) Then
      If accountApp.Applicants.ExistsPk(mAccountAppApplicantPk) Then
        accountAppApplicant = accountApp.Applicants.ItemByPk(mAccountAppApplicantPk)

        ' Create Client from Applicant
        Success = accountAppApplicant.CreateClient(True, client)
      Else
        Success = False
        finBL.Error.ErrorBegin("Applicant not found for this Account Application.")
      End If
    Else
      Success = False
    End If
  Else
    ' Client
    client = finBL.CreateClient()
    Success = client.Load(mClientId)
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Get Service Report
''' &lt;/summary&gt;
Private Function GetServiceReport(parametersJson As String,
                                  ByRef returnValue As String) As Boolean

  Dim Html As String
  Dim ServiceLogPk As Integer
  Dim Success As Boolean
  Dim ButtonAvailable_GetReport As Boolean
  Dim ButtonAvailable_DeleteRequest As Boolean

  ' Assume Success
  Success = True

  ' Get Parameters
  With mCombinedParameters
    ServiceLogPk = .GetInteger("ServiceLogPk")
  End With

  ' Get Report
  Html = GetServiceReportInternal(ServiceLogPk, ButtonAvailable_GetReport, ButtonAvailable_DeleteRequest)

  ' Finalise
  If Success Then
    returnValue = Html
  End If

  Return Success

End Function

Private Function GetServiceReportInternal(serviceLogPk As Integer,
                                    ByRef buttonAvailable_GetReport As Boolean,
                                    ByRef buttonAvailable_DeleteRequest As Boolean) As String

  Dim Html As String
  Dim ServiceLog As ISServiceLog

  ' Initialise ByRef Parameters
  buttonAvailable_GetReport = False
  buttonAvailable_DeleteRequest = False

  ' Get HTML
  If finBL.Database.GetServiceLog(serviceLogPk, ServiceLog) Then
    If Not finBL.CreditBureau.GetBankAccountEnquiryHtmlFromServiceLog(ServiceLog, Html) Then
      Html = finBL.GetHtmlErrorMessage(finBL.Error.Message, finBL.Error.Details)
    End If
  Else
    Html = finBL.GetHtmlErrorMessage(finBL.Error.Message, finBL.Error.Details)
  End If

  Return Html

End Function

''' &lt;summary&gt;
'''  Perform Enquiry
''' &lt;/summary&gt;
''' &lt;param name="parametersJson"&gt;
'''  A JSON formatted WizardFinishParameters object
''' &lt;/param&gt;
Private Function PerformEnquiry(parametersJson As String,
                                ByRef returnValue As String) As Boolean

  Dim AccountApp As finAccountApp
  Dim AccountAppApplicant As finAccountAppApplicant
  Dim AccountAppLogPk As Integer
  Dim BranchId As String
  Dim Client As finClient
  Dim ClientLogPk As Integer
  Dim BankAccountEnquiryRequest As ISCreditBureau4.ISBankAccountEnquiryRequest
  Dim BankAccountEnquiryResponse As ISCreditBureau4.ISBankAccountEnquiryResponse
  Dim ExecutePostFailed As Boolean
  Dim Html As String
  Dim obj As Object
  Dim ServiceLogPk As Integer
  Dim strTemp As String
  Dim Success As Boolean
  Dim Token As String
  Dim Warnings As ISValidationItems
  Dim WizardFinishParameters As WizardFinishParameters
  Dim UrlLink As String

  ' Assume Success
  Success = True
  
  ' Initialise
  Warnings = finBL.Runtime.CreateValidationItems()

  ' Parse Parameters
  If finBL.Runtime.WebUtilities.DeserialiseJsonStringToObject(parametersJson, GetType(WizardFinishParameters), obj) Then
    WizardFinishParameters = DirectCast(obj, WizardFinishParameters)
  Else
    Success = False
  End If

  ' Get Client (do not need Application objects)
  If Success Then
    Success = GetClientOrApplicant(Client, AccountApp, AccountAppApplicant)
  End If

  ' Create Request
  If Success Then
    BranchId = WizardFinishParameters.BranchId
    If Len(BranchId) = 0 Then BranchId = Client.BranchId

    If Len(WizardFinishParameters.DocumentId) &lt;&gt; 0 Then
      ' BrokerFlow
      BankAccountEnquiryRequest = finBL.CreditBureau.CreateBankAccountEnquiryRequest(SERVICE_ID, PRODUCT_ID_BROKERFLOW, BranchId)
    Else
      ' BankStatements
      BankAccountEnquiryRequest = finBL.CreditBureau.CreateBankAccountEnquiryRequest(SERVICE_ID, PRODUCT_ID, BranchId)
    End If
  
    If BankAccountEnquiryRequest Is Nothing Then
      Success = False
      finBL.Error.ErrorBegin("Could not create Bank Account Enquiry Request.")
    Else
      ' Update Request from Client
      If finBL.CreditBureau.UpdateBankAccountEnquiryRequestFromClient(BankAccountEnquiryRequest, Client) Then
        ' Ensure the Branch is what has been set in the UI, not from the Client
        If finBL.Branches.Exists(BranchId) Then
          BankAccountEnquiryRequest.BranchPk = finBL.Branches(BranchId).Pk
        End If

        If Len(WizardFinishParameters.DocumentId) &lt;&gt; 0 Then
          ' BrokerFlow
          With DirectCast(BankAccountEnquiryRequest, ISBankAccountEnquiryRequest_BankStatements_BrokerFlow)
            .DocumentId = WizardFinishParameters.DocumentId
          End With
        Else
          ' BankStatements
          With DirectCast(BankAccountEnquiryRequest, ISBankAccountEnquiryRequest_BankStatements_CreateRequest)
            .ReferralCode = WizardFinishParameters.ReferralCode
            .ExportDayCount = WizardFinishParameters.DaysToRetrieve
          End With
        End If  
      Else
        Success = False
      End If
    End If
 
    ' Execute
    If Success Then
      If Len(WizardFinishParameters.DocumentId) &lt;&gt; 0 Then
        ' BrokerFlow
        If finBL.CreditBureau.ExecuteBankAccountImport(BankAccountEnquiryRequest, BankAccountEnquiryResponse, mWorkflowPk, mWorkflowItemPk, ExecutePostFailed, ServiceLogPk, ClientLogPk, AccountAppLogPk) Then
          If ExecutePostFailed Then Warnings.Add(finBL.Error.Message())
        Else
          Success = False
        End If
      Else
        ' BankStatements
        If finBL.CreditBureau.ExecuteBankAccountEnquiryCreate(BankAccountEnquiryRequest, BankAccountEnquiryResponse, mWorkflowPk, mWorkflowItemPk, ExecutePostFailed, ServiceLogPk, ClientLogPk, AccountAppLogPk) Then
          With DirectCast(BankAccountEnquiryResponse, ISBankAccountEnquiryResponse_BankStatements_RequestStatus)
            Token = .ReferralCode
            UrlLink = .UrlLink
          End With
          If ExecutePostFailed Then Warnings.Add(finBL.Error.Message())
        Else
          Success = False
        End If
      End If
    End If
  End If    

  ' Get Report
  If Success Then
    Html = GetServiceReportInternal(ServiceLogPk, True, True)
  End If

  ' Complete Workflow Item
  If Success Then
    strTemp = ""
    finBL.HtmlWidgetUtilities.WorkflowItemComplete(mStartupParameters, strTemp)
    
    If Len(strTemp) &lt;&gt; 0 Then
      Warnings.Add("The Enquiry was completed successfully, however the Workflow Item could not be actioned due to the following error:" &amp; vbNewLine &amp; vbNewLine &amp; strTemp)
    End If    
  End If

  ' Finalise
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(New WizardFinishDetails(AccountAppLogPk, ClientLogPk, Html, ServiceLogPk, Token, UrlLink, Warnings.GetSummaryNumbered(False, False, True, , True, True)), returnValue)
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Validate a Wizard page.
''' &lt;/summary&gt;
''' &lt;param name="parametersJson"&gt;
'''  A JSON formatted object containing information required to validate a Wizard page.
''' &lt;/param&gt;
''' &lt;param name="returnValue"&gt;
'''  A JSON object; "true" if validation passed, otherwise, information as to why validation failed.
''' &lt;/param&gt;
Private Function WizardValidate(parametersJson As String,
                                ByRef returnValue As String) As Boolean

  Dim BranchId As String
  Dim ConfirmList As New List(Of String)
  Dim Data As Object
  Dim FailedControlId As String
  Dim FailedMessage As String
  Dim PageId As String
  Dim Product As String
  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Get Parameters
  ' NOTE: Use the module mCombinedParameters since this contains Startup and event Parameters in a single Key/Value List
  With mCombinedParameters
    PageId = .GetString("PageId")
  End With

  ' Validate Page
  Select Case PageId
    Case "General"
      ' Get Parameters
      With mCombinedParameters
        BranchId = .GetString("BranchId")
        Product = .GetString("Product")
      End With

      ' Is Service Available
      If Not finBL.CreditBureau.IsServiceAvailable(iseProductClass.BankAccountEnquiry, SERVICE_ID, BranchId) Then
        FailedControlId = "cboBranch"
        FailedMessage = String.Format("This Service is not available or configured for Branch '{0}'.", BranchId)
      End If
  End Select

  ' Finalise
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(New WizardValidateResponse(Data, FailedMessage, FailedControlId), returnValue)
  End If

  Return Success

End Function



''' &lt;summary&gt;
'''  Branch Information.
''' &lt;/summary&gt;
Public Class BranchInfo

  Public BranchId As String
  Public CostCentreText As String

  Public Sub New(branchRO As finBranchRO,
                 serviceId As String)

    Dim CostCentrePk As Integer

    Me.BranchId = branchRO.BranchId

    If finBLShared.Settings.AddOns.CostCentre Then
      If finBLShared.CostCentreFunctions.GetCostCentreFromBranchAndService(branchRO.Pk, serviceId, CostCentrePk) Then
        If finBLShared.CostCentres.ExistsPk(CostCentrePk) Then
          With finBLShared.CostCentres.ItemByPk(CostCentrePk)
            Me.CostCentreText = String.Format("This will be charged to Cost Centre &lt;b&gt;{0}&lt;/b&gt;, '{1}'.", .CostCentreId, finBLShared.HtmlEncode(.Description))
          End With
        End If
      End If
    End If

  End Sub

End Class



''' &lt;summary&gt;
'''  Wizard Initialisation Information.
''' &lt;/summary&gt;
Public Class FormInitialisationInfo

  ' Record
  Public AccountAppId As String
  Public AccountAppName As String
  Public AccountAppApplicantPk As Integer
  Public AccountAppApplicantName As String
  Public BranchId As String
  Public ClientId As String
  Public ClientName As String
  Public WorkflowPk As Integer

  ' Client Summary
  Public ClientSummary As String

  ' Lists
  Public Branches As New List(Of BranchInfo)

  ' Defaults

  ' Cost Centre Defaults
  Public OverrideExportDayCount As Boolean
  Public DefaultExportDayCount As Integer
  Public EnableBrokerFlow As Boolean

  ' Configuration
  Public ServiceName As String
  Public AllowBranch As Boolean
  Public ShowBranch As Boolean
  Public TestMode As Boolean

End Class



''' &lt;summary&gt;
'''  Organisation Search Result.
''' &lt;/summary&gt;
Public Class OrganisationSearchResult

  Public BusinessNumber As String
  Public CompanyName As String
  Public CompanyNumber As String
  Public Status As String

  Public Sub New(organisationSearchResult As ISCreditEnquiryResponse_EquifaxNZ_OrganisationSearchResult)

    With organisationSearchResult
      Me.BusinessNumber = .NZBN
      Me.CompanyName = .BusinessName
      Me.CompanyNumber = .OrganisationNumber
      Me.Status = .RegistrationStatus
    End With

  End Sub

End Class



''' &lt;summary&gt;
'''  Validation details
''' &lt;/summary&gt;
Public Class WizardValidateResponse

  Public Data As Object
  Public FailedMessage As String
  Public FailedControlId As String

  Public Sub New(data As Object,
                 failedMessage As String,
                 failedControlId As String)

    Me.Data = data
    Me.FailedMessage = failedMessage
    Me.FailedControlId = failedControlId

  End Sub

End Class



''' &lt;summary&gt;
'''  Finish Parameters
''' &lt;/summary&gt;
Public Class WizardFinishParameters

  ' General
  Public BranchId As String
  Public DaysToRetrieve As Integer
  Public DocumentId As String
  Public ReferralCode As String

End Class



''' &lt;summary&gt;
'''  Finish details
''' &lt;/summary&gt;
Public Class WizardFinishDetails

  ' General
  Public AccountAppLogPk As Integer
  Public ClientLogPk As Integer
  Public Html As String
  Public ServiceLogPk As Integer
  Public Token As String
  Public UrlLink As String
  Public Warning As String

  Public Sub New(accountAppLogPk As Integer,
                 clientLogPk As Integer,
                 html As String,
                 serviceLogPk As Integer,
                 token As String,
                 urlLink As String,
                 warning As String)

    Me.AccountAppLogPk = accountAppLogPk
    Me.ClientLogPk = clientLogPk
    Me.Html = html
    Me.ServiceLogPk = serviceLogPk
    Me.Token = token
    Me.UrlLink = urlLink
    Me.Warning = warning

  End Sub

End Class</Code>
    <Language>VisualBasic</Language>
    <Notes>System defined HTML Widget.

Used as a finPOWER Connect Cloud compatible wizard to allow a "illion BankStatements" Bank Account enquiry to be performed.</Notes>
    <PermissionKeyExecute />
    <ReferenceLinq>false</ReferenceLinq>
    <RunWithoutPrompts>false</RunWithoutPrompts>
    <TemplateText>&lt;div id="frmMain" class="is-widget-content" style="visibility:hidden"&gt;

  &lt;!-- Form Header --&gt;
  &lt;header&gt;
    &lt;div class="header"&gt;&lt;/div&gt;
    &lt;div class="summary"&gt;&lt;/div&gt;
    &lt;!-- Tabs --&gt;
    &lt;div id="tabWizard" class="is-tabs"&gt;
      &lt;ul&gt;
        &lt;li tabId="General" tooltipText="Confirm who this enquiry is being made upon."&gt;Bank Account Enquiry&lt;/li&gt;
        &lt;li tabId="Enquiry" tooltipText="Bank Account Enquiry results."&gt;Bank Account Enquiry Report&lt;/li&gt;
      &lt;ul&gt;
    &lt;/div&gt;
  &lt;/header&gt;

  &lt;!-- Pages --&gt;
  &lt;div class="is-widget-form-body"&gt;
    &lt;!-- General --&gt;
    &lt;div id="pageGeneral"&gt;
      &lt;table class="is-form"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:10em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblRecord"&gt;Client&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboRecord"&gt;Client:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboRecord" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style="display:none"&gt;
          &lt;th&gt;&lt;label for="cboApplicant"&gt;Applicant:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboApplicant" /&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblBranch"&gt;Select the Branch to allocate costs to&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboBranch"&gt;Branch:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboBranch" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;/th&gt;
          &lt;td colspan="2"&gt;&lt;div id="divCostCentreInformation" class="is-info-text info small" style="display:none"&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;!-- Options --&gt;
        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblEnquiryOptions"&gt;Enter the BankStatements Enquiry details&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;div id="rblEnquiryOptions"&gt;&lt;/div&gt;&lt;/th&gt;
        &lt;/tr&gt;
        
        &lt;!-- BrokerFlow --&gt;
        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblDocumentId"&gt;Enter an existing BrokerFlow Document Id&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtDocumentId"&gt;Document Id:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtDocumentId" /&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;!-- Existing Enquiry --&gt;
        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblReferralCode"&gt;Enter an existing Referral Code&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtReferralCode"&gt;Referral Code:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtReferralCode" /&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblOptions"&gt;Options&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="numDaysToRetrieve"&gt;Days to Retrieve:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="numDaysToRetrieve" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;

    &lt;!-- Enquiry --&gt;
    &lt;div id="pageEnquiry"&gt;
      &lt;div id="wbSummary" class="is-dock-fill"&gt;&lt;/div&gt;
    &lt;/div&gt;

  &lt;/div&gt;

  &lt;!-- Form Footer --&gt;
  &lt;footer&gt;
    &lt;button id="cmdCancel" class="is-button"&gt;Cancel&lt;/button&gt;
    &lt;button id="cmdBack" class="is-button"&gt;&amp;lt; Back&lt;/button&gt;
    &lt;button id="cmdNext" class="is-button"&gt;Next &amp;gt;&lt;/button&gt;
    &lt;button id="cmdFinish" class="is-button ok"&gt;Finish&lt;/button&gt;
  &lt;/footer&gt;

&lt;/div&gt;



&lt;script&gt;
// Properties
var mRecord;
var mEnquiryDetails;

// Controls
var C = {
  // General
  lblRecord: null,
  cboRecord: null,
  cboApplicant: null,

  lblBranch: null,
  cboBranch: null,
  divCostCentreInformation: null,

  lblEnquiryOptions: null,
  rblEnquiryOptions: null,
          
  lblDocumentId: null,
  txtDocumentId: null,
  
  lblReferralCode: null,
  txtReferralCode: null,

  lblOptions: null,
  numDaysToRetrieve: null,

  // Enquiry
  wbSummary: null
}

// Form
var frmMain;
var tabWizard;

// Wizard Buttons
var cmdCancel;
var cmdBack;
var cmdNext;
var cmdFinish;

// Other
var mLastProduct = "";
var mLastFinishParametersJson = "";

// ==========
// Initialise
// ==========
$(function () {
  // Mobile optimisations
  $(window).resize(Form_Resize);

  // --------
  // Controls
  // --------
  //   General
  C.lblRecord = widget.UI.Label("lblRecord", {});
  C.cboRecord = widget.UI.DBCombo("cboRecord", {
    autoReadOnly: false,
    readOnly: true,
    showDropdown: false,
    width: widget.UI.FIELD_WIDTH_CODE_10
  });
  C.cboApplicant = widget.UI.DBCombo("cboApplicant", {
    autoReadOnly: false,
    readOnly: true,
    showDropdown: false,
    width: widget.UI.FIELD_WIDTH_CODE_10
  });

  C.lblBranch = widget.UI.Label("lblBranch", {});
  C.cboBranch = widget.UI.DBCombo("cboBranch", {
    width: widget.UI.FIELD_WIDTH_CODE_10,

    onChange: cboBranch_Change,
  });
  C.divCostCentreInformation = $("#divCostCentreInformation");

  C.lblEnquiryOptions = widget.UI.Label("lblEnquiryOptions", {});
  C.rblEnquiryOptions = widget.UI.RadioButtonList("rblEnquiryOptions", {
    allowBlank: false,

    onChange: rblEnquiryOptions_Change,
  });
  
  C.lblDocumentId = widget.UI.Label("lblDocumentId", {});
  C.txtDocumentId = widget.UI.TextBox("txtDocumentId", {
    maxLength: 30,
    allowBlank: false
  });

  C.lblReferralCode = widget.UI.Label("lblReferralCode", {});
  C.txtReferralCode = widget.UI.TextBox("txtReferralCode", {
    maxLength: 30,
    allowBlank: false
  });

  C.lblOptions = widget.UI.Label("lblOptions", {});
  C.numDaysToRetrieve = widget.UI.NumberBox("numDaysToRetrieve", {
    minValue: 0,
    maxValue: 999999,
    decimals: 0,
    showSeparators: false
  });

  // Enquiry
  C.wbSummary = widget.UI.PreviewPane("wbSummary", {});

  // Grids

  // Create Widget form
  // NOTE: Hide by default for a cleaner startup
  frmMain = new widget.UI.Form("frmMain", { visible: false });

  // Create Tabs
  tabWizard = new widget.UI.Tabs("tabWizard", { style: "wizard" });

  // Handle Wizard Buttons
  cmdCancel = $("#cmdCancel");
  cmdBack = $("#cmdBack");
  cmdNext = $("#cmdNext");
  cmdFinish = $("#cmdFinish");
  cmdCancel.click(tabWizard_Cancel);
  cmdBack.click(function() { tabWizard_Move(-1); });
  cmdNext.click(function() { tabWizard_Move(1); });
  cmdFinish.click(function() { Form_ExecuteAction("Finish"); });

  // Handle Notifications
  widget.ActionNotificationHandle(Widget_NotificationHandler);

  // Reset
  Form_Reset();
});

// ==========
// Reset Form
// ==========
function Form_Reset() {
  // Defaults

  // Controls

  // Set Tab
  tabWizard.SelectedTabId("General");

  // Resize
  Form_Resize();

  // Load Record (i.e., initialise wizard)
  Record_Load();
}

// ===========
// Load Record
// ===========
function Record_Load() {
  // Initialise
  mRecord = null;

  // Hide content
  frmMain.Visible(false);

  // Block UI
  widget.UI.Block("Initialising, please wait...");

  // Load Initialisation details
  widget.GetString("GetInitialisationInfo", {},
    // Success
    function (data) {
      mRecord = JSON.parse(data);

      // Give Collections ability to lookup by code
      widget.ArrayAllowLookupById(mRecord.Branches, "BranchId");

      // Load Fields
      Fields_Load();
    },

    // Fail
    function (message) {
      widget.UI.MsgBoxAlert("fail: " + message);
      Fields_Load();
    }
  );
}

// ===========
// Load Fields
// ===========
function Fields_Load() {
  if (mRecord) {
    // General
    if (mRecord.AccountAppId) {
      // Applicant
      C.lblRecord.Text("Account Application");
      C.cboRecord.Caption("Application:");
      C.cboRecord.RefreshUnbound(mRecord.AccountAppId, mRecord.AccountAppName);
      C.cboApplicant.RefreshUnbound(mRecord.AccountAppApplicantPk, mRecord.AccountAppApplicantName);
    }
    else {
      // Client
      C.lblRecord.Text("Client");
      C.cboRecord.Caption("Client:");
      C.cboRecord.RefreshUnbound(mRecord.ClientId, mRecord.ClientName);
    }
    C.cboBranch.Text(mRecord.BranchId);

    var list = [];
    list.push({ caption: "New Enquiry", value: "NewEnquiry" });
    if(mRecord.EnableBrokerFlow) {    
      list.push({ caption: "BrokerFlow", value: "BrokerFlow" });
    }    
    list.push({ caption: "Existing Referral Code", value: "ExistingEnquiry" });
    C.rblEnquiryOptions.ListFromArray(list);
    C.rblEnquiryOptions.Value("NewEnquiry");
    rblEnquiryOptions_Change();
    
    if(mRecord.OverrideExportDayCount) {
      C.numDaysToRetrieve.Value(mRecord.DefaultExportDayCount);
    }
  }

  // Unblock UI
  widget.UI.Unblock();

  // Update Controls

  // Update fields
  Fields_Update();

  // Refresh Tab
  tabWizard_Refresh();
}

// ===========
// Save Fields
// ===========
function Fields_Save() {
  // Not used by this wizard since there is no concept of updating an object behind the wizard
}

// =============
// Update Fields
// =============
function Fields_Update() {
  // Heading
  if (mRecord &amp;&amp; mRecord.TestMode) {
    widget.SetHeading(mRecord.ServiceName + " Bank Account Enquiry (Test Mode)");
  }

  // Information Lists

  // Lists
  if (mRecord) {
    if (mRecord.ShowBranch) {
      C.cboBranch.RefreshFromStandardRange("Branches");
    }
  }

  // Controls
  if (mRecord) {
    C.cboApplicant.VisibleRow(mRecord.AccountAppApplicantPk != 0);
    
    C.lblBranch.ReadOnly(mRecord.AllowBranch);
    C.cboBranch.ReadOnly(mRecord.AllowBranch);
    C.lblBranch.VisibleRow(mRecord.ShowBranch);
    C.cboBranch.VisibleRow(mRecord.ShowBranch);
    
    if(!mRecord.OverrideExportDayCount) {
      C.lblOptions.VisibleRow(false);
      C.numDaysToRetrieve.VisibleRow(false);
    }

    cboBranch_Change();
  }

  // Update Buttons
  tabWizard_UpdateButtons();

  // Show content
  frmMain.Visible(mRecord != null);

  // Resize Tab
  tabWizard_Resize();
}

// ================
// cboBranch_Change
// ================
function cboBranch_Change(sender, e) {
  // Handled
  if (e) e.ChangeHandled = true;

  // Hide by default
  C.divCostCentreInformation.hide();

  // Get Cost Centre message
  if (mRecord.ShowBranch &amp;&amp; C.cboBranch.Text()) {
    var branch = mRecord.Branches.GetItem(C.cboBranch.Text());

    if (branch) {
      var message = branch.CostCentreText;
    }
  }

  // Show / Hide message
  if (message) {
    C.divCostCentreInformation.html(message);
    C.divCostCentreInformation.show();
  }
}

// ===============
// rblConfirmOwner
// ===============
function rblEnquiryOptions_Change(sender, e) {
  // Reset
  C.lblDocumentId.VisibleRow(false);
  C.txtDocumentId.VisibleRow(false);
  C.lblReferralCode.VisibleRow(false);
  C.txtReferralCode.VisibleRow(false);
  C.lblOptions.VisibleRow(false);
  C.numDaysToRetrieve.VisibleRow(false);
  
  // Show Controls
  var enquiryType = C.rblEnquiryOptions.Value();

  switch (enquiryType) {
    case "NewEnquiry":
      C.lblOptions.VisibleRow(true);
      C.numDaysToRetrieve.VisibleRow(true);
      break;

    case "BrokerFlow":
      C.lblDocumentId.VisibleRow(true);
      C.txtDocumentId.VisibleRow(true);
      break;

    case "ExistingEnquiry":
      C.lblReferralCode.VisibleRow(true);
      C.txtReferralCode.VisibleRow(true);
      break;

    default:
      window.alert("Enquiry Type '" + enquiryType + "' not handled.");
      break;
  }
}

// ===============================
// Create Wizard Finish Parameters
// ===============================
function CreateFinishParameters() {

  var params = {
    branchId: C.cboBranch.Text()    
  }

  switch (C.rblEnquiryOptions.Value()) {
    case "NewEnquiry":
      params.DaysToRetrieve = C.numDaysToRetrieve.Value();
      params.DocumentId = "";
      params.ReferralCode = "";
      break;

    case "BrokerFlow":
      params.DaysToRetrieve = 0;
      params.DocumentId = C.txtDocumentId.Text();
      params.ReferralCode = "";
      break;

    case "ExistingEnquiry":
      params.DaysToRetrieve = 0;
      params.DocumentId = "";
      params.ReferralCode = C.txtReferralCode.Text();
      break;
  }

  return params;
}

// =================
// Execute an Action
// =================
function Form_ExecuteAction(actionId) {
  switch (actionId.toUpperCase()) {
    case "FINISH":
      // Finish
      Form_ExecuteAction_Finish();
      break;

    default:
      window.alert(mViewName + ".Form_ExecuteAction: Unhandled action '" + actionId + "'");
      break;
  }
}

// =============
// Finish Action
// =============
function Form_ExecuteAction_Finish() {
  widget.Close();
}

// ===========
// Resize Form
// ===========
function Form_Resize() {
  // Tab
  tabWizard_Resize();
}

// ===============
// Perform Enquiry
// ===============
function PerformEnquiry(successCallback) {
  // Block UI
  widget.UI.Block("Performing Enquiry, please wait...");

  // Save parameters
  mLastFinishParametersJson = JSON.stringify(CreateFinishParameters());

  // Perform Enquiry
  widget.GetString("PerformEnquiry", CreateFinishParameters(), function (data) { PerformEnquiry_Success(data, successCallback); }, PerformEnquiry_Fail);
}

function PerformEnquiry_Success(data, successCallback) {
  // Parse
  mEnquiryDetails = JSON.parse(data);

  // Show Enquiry Details
  C.wbSummary.SetContent(mEnquiryDetails.Html, false);

  // Unblock UI
  widget.UI.Unblock();

  // Callback
  successCallback();

  // Show warning
  if (mEnquiryDetails.Warning) widget.UI.MsgBoxAlert(mEnquiryDetails.Warning);

  // Refresh Parent (to show updated details)
  widget.RefreshParent();
}

function PerformEnquiry_Fail(error) {
  // Unblock UI
  widget.UI.Unblock();

  widget.UI.MsgBoxAlert(error);
}

// ==========
// Tab Wizard
// ==========
function tabWizard_Cancel() {
  widget.Close();
}

function tabWizard_Move(direction) {
  var Ok;

  // Validate
  if (direction &gt; 0) {
    tabWizard_Validate(function () { tabWizard_MovePost(direction); });
  }
  else {
    // Can always move backwards
    tabWizard_MovePost(direction);
  }
}

function tabWizard_MovePost(direction) {
  var Ok = true;

  // Find Next Tab to Move To
  if (Ok) {
    var found = false;
    var newTab = tabWizard.SelectedTabIndex();

    do {
      newTab += direction;

      switch (tabWizard.GetTabIdByIndex(newTab)) {
        default:
          found = true;
          break;
      }

      // Found?
      if (found) {
        break;
      }
      else if (newTab == tabWizard.TabCount() - 1) {
        // Just in case!
        widget.UI.MsgBoxAlert("tabWizard_MovePost: Tab not handled!");
        break;
      }
    }
    while (true);

    // Refresh the New Tab
    tabWizard_Refresh(newTab);
  }
}

function tabWizard_Refresh(newTab) {
  // Moving forward onto tab, so Load information
  if (newTab &gt;= tabWizard.SelectedTabIndex()) {
    switch (tabWizard.GetTabIdByIndex(newTab)) {
      default:
        break;
    }
  }

  // Make Tab it
  tabWizard.SelectedTabIndex(newTab);

  // Tweak fields

  // Update Heading
  switch (tabWizard.SelectedTabId()) {
    case "General":
      frmMain.RefreshHeading(mRecord.ServiceName + " Bank Account Enquiry", tabWizard.TabTooltipText(tabWizard.SelectedTabId()));
      break;

    default:
      frmMain.RefreshHeading(tabWizard.TabCaption(tabWizard.SelectedTabId()), tabWizard.TabTooltipText(tabWizard.SelectedTabId()));
      break;
  }

  // Back, Next command buttons valid?
  tabWizard_UpdateButtons();

  // Resize Wizard
  tabWizard_Resize();

  // Focus
  switch (tabWizard.SelectedTabId()) {
    default:
      tabWizard.FocusFirst();
      break;
  }
}

function tabWizard_Resize() {
  switch (tabWizard.SelectedTabId()) {
    case "General":
      C.cboRecord.WidthResizeFromParent();
      C.txtReferralCode.WidthResizeFromParent();
      C.txtDocumentId.WidthResizeFromParent();
      break;

    default:
      break;
  }
}

function tabWizard_UpdateButtons() {
  // Back and Next Buttons?
  if (tabWizard.TabCount() == 1) {
    cmdBack.hide();
    cmdNext.hide();
  }
  else {
    var tabIndex = tabWizard.SelectedTabIndex();
    cmdBack.prop("disabled", tabIndex &lt;= 0);
    cmdNext.prop("disabled", tabIndex &gt;= tabWizard.TabCount() - 1);
  }

  // Finish Button
  if (tabWizard.TabCount() != 1) cmdFinish.prop("disabled", !cmdNext.prop("disabled"));
}

function tabWizard_Validate(validCallback) {
  // Validate
  var Ok = tabWizard.Validate(true);

  // Other client-side validation
  if (Ok) {
    switch (tabWizard.SelectedTabId()) {
      case "General":
        // General Page has server-side validation, so do not assume default for this page
        break;

      default:
        // No validation
        validCallback();
        return;
    }
  }

  // Server-side validation
  if (Ok) {
    var params;

    switch (tabWizard.SelectedTabId()) {
      case "General":
        params = {
          branchId: C.cboBranch.Text()
        };
        break;
    }

    if (params) {
      // Disable Form
      frmMain.FormDisable("Validating");

      // Extend parameters
      params.pageId = tabWizard.SelectedTabId();

      // Call WizardValidate method in Script
      widget.GetString("WizardValidate",
                       params,
                       function (data) { tabWizard_ValidatePost(validCallback, data); },
                       tabWizard_ValidateFail);
    }
    else {
      // No server-side validation
      validCallback();
    }
  }
}

function tabWizard_ValidatePost(validCallback, data) {
  // Enable form
  frmMain.FormEnable();

  // Parse Data
  var o = {};
  if (data) o = JSON.parse(data);

  if (o.FailedMessage) {
    // -----------------
    // Validation failed
    // -----------------
    var o = JSON.parse(data);
    widget.UI.MsgBoxAlert(o.FailedMessage);
    if (o.FailedControlId) $("#" + o.FailedControlId).focus();
  }
  else {
    // ---------------------
    // Validation successful
    // ---------------------
    // Validation could pass back additional information, e.g., to use in tabWizard_Refresh
    switch (tabWizard.SelectedTabId()) {
      case "General":
        // Confirm
        if (mEnquiryDetails) {
          // Already created so just move on
          validCallback();
        }
        else {
          if(C.txtReferralCode.Text().length == 0 &amp;&amp; C.txtDocumentId.Text().length == 0) {
            var message = "Are you sure you want to perform a " + mRecord.ServiceName + " Bank Account Enquiry?\n\n";
            if (mRecord.WorkflowPk) {
              message += "NOTE: The Workflow Item that this Credit Enquiry is being peformed for will be completed.\n\n"
            }
            if (mRecord.TestMode) {
              message += "NOTE: You are in 'Test Mode' so no cost will be incurred."
            }
            else {
              message += "This function incurs a cost.\n\nFor more information please refer to the Terms and Conditions of your Agreement with this Service provider.";
            }
            widget.UI.MsgBoxConfirm(message, { heading: "Perform Bank Account Enquiry" }, function () { PerformEnquiry(validCallback); });
          }
          else {
            PerformEnquiry(validCallback);
          }
        }
        return;
    }

    // Callback
    validCallback();
  }
}

function tabWizard_ValidateFail(errorMessage)
{
  widget.UI.MsgBoxAlert(errorMessage);

  // Enable form
  frmMain.FormEnable();
}

// =========
// wbSummary
// =========
function wbSummary_Refresh() {
  widget.GetString("GetServiceReport", { serviceLogPk: mEnquiryDetails.ServiceLogPk },
    function (data) {
      C.wbSummary.SetContent(data, false);
    },

    function (error) {
      widget.UI.MsgBoxAlert(error);
    }
  );
}

// ====================
// Notification Handler
// ====================
function Widget_NotificationHandler(actionId, data) {
  switch(actionId.toUpperCase()) {
    case "BANKACCOUNTENQUIRY.REFRESH":
      wbSummary_Refresh();
      break;

    default:
      break;
  }
}
&lt;/script&gt;</TemplateText>
    <TemplateTextBookmarks />
    <TimeoutSeconds>120</TimeoutSeconds>
    <UniqueId>l3Gwe+O8hUuzbDINEwskyg</UniqueId>
    <AllowRefresh>true</AllowRefresh>
    <Caption />
    <HtmlWidgetAllowInitialEventCaching>false</HtmlWidgetAllowInitialEventCaching>
    <HtmlWidgetMaxHeight>800</HtmlWidgetMaxHeight>
    <HtmlWidgetMaxWidth>800</HtmlWidgetMaxWidth>
    <HtmlWidgetNeverApplyStyling>false</HtmlWidgetNeverApplyStyling>
    <HtmlWidgetResourceChartsApex>false</HtmlWidgetResourceChartsApex>
    <HtmlWidgetResourceCssSummaryPage2>false</HtmlWidgetResourceCssSummaryPage2>
    <HtmlWidgetResourceCssWidget>true</HtmlWidgetResourceCssWidget>
    <HtmlWidgetResourceJQuery>true</HtmlWidgetResourceJQuery>
    <HtmlWidgetResourceJQueryVersion />
    <HtmlWidgetSpecialEventGetFolderCount>false</HtmlWidgetSpecialEventGetFolderCount>
    <HtmlWidgetSpecialEventShowAsSummaryPage>false</HtmlWidgetSpecialEventShowAsSummaryPage>
    <HtmlWidgetSummaryPageObjectType>None</HtmlWidgetSummaryPageObjectType>
    <Icon>Logo_Illion</Icon>
    <RestrictedOriginsListEnabled>false</RestrictedOriginsListEnabled>
    <RunAsAdministrator>false</RunAsAdministrator>
    <WebServiceName />
    <WebServiceAllowAnonymous>false</WebServiceAllowAnonymous>
    <WebServiceSendDebugInformation>false</WebServiceSendDebugInformation>
    <ShowInMenu>None</ShowInMenu>
    <ParametersType>Custom</ParametersType>
    <Parameters>
      <ISParameterDefs version="1.00">
        <Parameters>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>Form options.</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText>If you do not specify a Default Transaction Type, the Transaction Type selection will be shown regardless of the settings specified below.</TooltipText>
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>TESTING</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText>These are the Parameters required by this HTML Widget to function correctly.
They are listed here for testing purposes only.</TooltipText>
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="ClientId" type="List">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <List>RANGE.Clients</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="AccountAppId" type="List">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <List>RANGE.AccountApps</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="AccountAppApplicantPk" type="Number">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <DecimalPlaces>0</DecimalPlaces>
            <GroupDigits>true</GroupDigits>
            <MaxValue />
            <MinValue />
            <NumberSpecialType>None</NumberSpecialType>
            <SpinChange>1</SpinChange>
          </Parameter>
          <Parameter name="BranchId" type="List">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <List>RANGE.Branches</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="WorkflowPk" type="Number">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <DecimalPlaces>0</DecimalPlaces>
            <GroupDigits>true</GroupDigits>
            <MaxValue />
            <MinValue />
            <NumberSpecialType>None</NumberSpecialType>
            <SpinChange>1</SpinChange>
          </Parameter>
          <Parameter name="WorkflowItemPk" type="Number">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <DecimalPlaces>0</DecimalPlaces>
            <GroupDigits>true</GroupDigits>
            <MaxValue />
            <MinValue />
            <NumberSpecialType>None</NumberSpecialType>
            <SpinChange>1</SpinChange>
          </Parameter>
        </Parameters>
      </ISParameterDefs>
    </Parameters>
  </finScript>