<?xml version="1.0" encoding="utf-8"?>
  <finScript version="1.00" exportedUtcDate="2024-03-03T23:58:47.0000000">
    <CreatedUserId>ADMIN</CreatedUserId>
    <CreatedUtcDate>2024-03-03T22:57:24.2630000</CreatedUtcDate>
    <UpdatedUserId>ADMIN</UpdatedUserId>
    <UpdatedUtcDate>2024-03-03T23:54:22.0430000</UpdatedUtcDate>
    <ScriptId>HWBRANCHEDIT</ScriptId>
    <Description>Branch Edit</Description>
    <ScriptType>HtmlWidget</ScriptType>
    <Active>true</Active>
    <AllowUI>false</AllowUI>
    <Bookmarks />
    <Category />
    <Code>' HtmlWidget_BranchEdit
Option Explicit On
Option Strict On

' #################################################################
' Branch Edit form HTML Widget
'
' Version: 1.03 (04/03/2024)
'
' Usage: System-supplied HTML Widget
' #################################################################
' Version        Date  User     Job       Description
' -------  ----------  -------  --------  -------------------------
'    1.00  16/12/2021  ISS      J027916   Created
'          07/06/2022  ISS      J028452   User Defined fields not retaining indexes
'          23/11/2022  ISS      J030061   Add missing tooltips
'    1.01  29/05/2023  ISS      J031158   SPG field increased to 10 characters
'    1.02  23/08/2023  ISS      J031803   Added Zepto PayID option
'    1.03  04/03/2024  ISS      J033018   Update obsoleted function
' #################################################################

' Constants
Private Const FORM_KEY As String = "Branches"

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

' Standard Parameters
Private mBranchId As String
Private mDuplicateRecordId As String
Private mPage As String
Private mReadOnly As Boolean

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 Standard Parameters
  With mStartupParameters
    mBranchId = .GetString("BranchId") ' Always use Startup Parameters since the Branch Id may be updated
  End With
  With mCombinedParameters
    mDuplicateRecordId = .GetString("DuplicateRecordId")
    mPage = .GetString("Page")
    mReadOnly = .GetBoolean("ReadOnly")
  End With

  ' Validate
  Main = finBL.HtmlWidgetUtilities.HasPermissionToViewFormKey(FORM_KEY)

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

      Case "Finish"
        ' Finish wizard
        Main = Finish(parametersJson, requestInfo, returnValue)

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

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

End Function

''' &lt;summary&gt;
'''  Load Branch.
''' &lt;/summary&gt;
Private Function GetBranch(ByRef Branch As finBranch) As Boolean

  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Validate

  ' Create and Load Branch
  If Success Then
    ' Create Branch
    Branch = finBL.CreateBranch()

    ' Load Branch
    If Len(mDuplicateRecordId) &lt;&gt; 0 Then
      ' New record (by duplicating existing)
      Success = Branch.Load(mDuplicateRecordId)
      If Success Then Branch.Duplicate()
    ElseIf Len(mBranchId) = 0 Then
      ' New record
    Else
      Success = Branch.Load(mBranchId)
    End If
  End If

  Return Success

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 Branch As finBranch
  Dim EntityRO As finEntityRO
  Dim FormInitialisationInfo As FormInitialisationInfo
  Dim ParameterSetPk As Integer
  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Validate

  ' Get Branch
  If Success Then
    Success = GetBranch(Branch)
  End If

  ' Find Parameter Set to Use (zero represents an auto-generated set)
  If Success Then
    ParameterSetPk = finBL.ClientGroups(Branch.Client.ClientGroupId).UserDefinedParameterSetPk
  End If

  ' Get Initialisation Info
  If Success Then
    FormInitialisationInfo = New FormInitialisationInfo()
    With FormInitialisationInfo
      ' Form
      .PageId = mPage
      If finBL.Database.IsReadOnly OrElse mReadOnly OrElse Not finBL.CurrentUser.Permissions.Allow("Admin.Branches") Then
        .ReadOnly = True
      Else
        .ReadOnly = False
      End If

      ' Record
      .Pk = Branch.Pk
      .Timestamp = Branch.Timestamp

      ' Page Permissions (defined here since they are used below)
      .AllowPageGeneral = True
      .AllowPageOptions = True
      .AllowPageMessaging = finBL.Settings.AddOns.Entity
      .AllowPageUserDefined = (ParameterSetPk &lt;&gt; 0)

      ' General
      .BranchId = Branch.BranchId ' Always need to return Branch Id
      If .AllowPageGeneral Then
        .Active = Branch.Active
        .Description = Branch.Description

        .ClientId = Branch.Client.ClientId
        .ClientName = Branch.Client.Name

        .Name = Branch.Name

        .EntityId = Branch.EntityId

        .CostCentreId = Branch.CostCentreId

        .LogoFileName = Branch.LogoFileName
        .LogoFileName2 = Branch.LogoFileName2

        .LogoResource1Id = Branch.LogoResource1Id
        .OtherResource1Id = Branch.OtherResource1Id

        .GooglePlaceId = Branch.GooglePlaceId

        .Notes = Branch.Notes
      End If

      ' Options
      If .AllowPageOptions Then
        .CalendarWorkingId = Branch.CalendarWorkingId

        .DefaultState = Branch.DefaultState

        .SecuredPartyGroupId = Branch.SecuredPartyGroupId
        
        .PayIdPaymentMethodId = Branch.PayIdPaymentMethodId
      End If

      ' Messaging
      If .AllowPageMessaging Then
        .EmailDisclaimer = Branch.EmailDisclaimer
      End If

      ' User Defined
      If .AllowPageUserDefined Then
        .UserDefinedParameters = finBL.CreateWsParameters(finBL.ClientFunctions.CreateUserDefinedParameters(ParameterSetPk, False))
        .UserDataJson = Branch.Client.UserData.ToSimpleJsonString()
      End If

      ' Other

      ' Permissions

      ' Lists
      .EmailDisclaimerTagsList = finBL.DocumentFunctions.GetAvailableSmsAndEmailTags(False, False, False, False, True, False, False, True, False, False).ToJsonObject()
      .ResourceImageFilter = finBL.HtmlWidgetUtilities.EncryptSql(finBL.Resources.GetDataViewFilter("Image", False, False, False, False, isefinResourceType.None))
      .StatesList = finBL.CurrentCountry.AddressStatesList.ToCsvString()

      For Each EntityRO In finBL.Entities
        .Entities.Add(New Entity(EntityRO))        
      Next 
      
      ' Configuration
      .AddOnBankingAdvanced_Split = finBL.Settings.AddOns.BankingAdvanced_Split
      .AddOnCostCentre = finBL.Settings.AddOns.CostCentre
      .AddOnSecurityRegister = finBL.Settings.AddOns.SecurityRegister
      .HideOtherPages = mCombinedParameters.GetBoolean("HideOtherPages", False)
      .PromptOnSave = finBL.CloudConnectFunctions.CloudConnectSettings.PromptOnSave
    End With
  End If

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

  Return Success

End Function

''' &lt;summary&gt;
'''  Finish, i.e., Save Branch.
''' &lt;/summary&gt;
''' &lt;param name="parametersJson"&gt;
'''  A JSON formatted record (FormInitialisationInfo) object.
''' &lt;/param&gt;
Private Function Finish(parametersJson As String,
                        requestInfo As finScriptRequestInfo,
                        ByRef returnValue As String) As Boolean

  Dim Branch As finBranch
  Dim obj As Object
  Dim ParameterSetPk As Integer
  Dim Record As FormInitialisationInfo
  Dim Success As Boolean

  ' Assume Success
  Success = True

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

  ' Get Branch
  If Success Then
    Success = GetBranch(Branch)
  End If

  ' Find Parameter Set to Use (zero represents an auto-generated set)
  If Success Then
    ParameterSetPk = finBL.ClientGroups(Branch.Client.ClientGroupId).UserDefinedParameterSetPk
  End If

  ' Validate
  If Success Then
    If Record.Timestamp &lt;&gt; Branch.Timestamp Then
      Success = False
      finBL.Error.ErrorBegin("This record has been updated by another User.")
    End If
  End If

  ' Update and Save
  ' NOTE: Recheck Permissions in addition to the 'AllowPage' properties before updating to prevent spoofing
  If Success Then
    ' Begin Transaction
    If finBL.Database.TransactionBegin() Then
      ' Update Branch
      With Branch
        ' General
        If Record.AllowPageGeneral Then
          .BranchId = Record.BranchId
          .Active = Record.Active
          .Description = Record.Description

          .Name = Record.Name

          .EntityId = Record.EntityId

          .CostCentreId = Record.CostCentreId

          .LogoFileName = Record.LogoFileName
          .LogoFileName2 = Record.LogoFileName2

          .LogoResource1Id = Record.LogoResource1Id
          .OtherResource1Id = Record.OtherResource1Id

          .GooglePlaceId = Record.GooglePlaceId

          .Notes = Record.Notes
        End If

        ' Options
        If Record.AllowPageOptions Then
          .CalendarWorkingId = Record.CalendarWorkingId

          .DefaultState = Record.DefaultState

          .SecuredPartyGroupId = Record.SecuredPartyGroupId
          
          .PayIdPaymentMethodId = Record.PayIdPaymentMethodId
        End If

        ' Messaging
        If Record.AllowPageMessaging AndAlso finBL.Settings.AddOns.Entity Then
          .EmailDisclaimer = Record.EmailDisclaimer
        End If

        ' User Defined
        If Record.AllowPageUserDefined AndAlso ParameterSetPk &lt;&gt; 0 Then
          .Client.UserData.FromHtmlWidgetParametersJsonString(Record.UserDataJson)
        End If
      End With

      ' Save
      If Success Then
        Success = Branch.Save()
      End If

      ' Commit/ Rollback Transaction
      If Success Then
        finBL.Database.TransactionCommit()
      Else
        finBL.Database.TransactionRollback()
      End If
    Else
      Success = False
    End If
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Validate a Wizard page.
''' &lt;/summary&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 Data As Object
  Dim FailedControlId As String
  Dim FailedMessage As String
  Dim PageId 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"
      ' General
  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;
'''  Wizard Initialisation Information.
''' &lt;/summary&gt;
''' &lt;remarks&gt;
'''  This object is also used to save the Employment.
''' &lt;/remarks&gt;
Public Class FormInitialisationInfo

  ' Form
  Public PageId As String
  Public [ReadOnly] As Boolean

  ' Record
  Public Pk As Integer
  Public Timestamp As Integer

  ' General
  Public BranchId As String
  Public Active As Boolean
  Public Description As String

  Public ClientId As String
  Public ClientName As String
  Public Name As String

  Public EntityId As String

  Public CostCentreId As String

  Public LogoFileName As String
  Public LogoFileName2 As String

  Public LogoResource1Id As String
  Public OtherResource1Id As String

  Public GooglePlaceId As String

  Public Notes As String

  ' Options
  Public CalendarWorkingId As String

  Public DefaultState As String

  Public SecuredPartyGroupId As String

  Public PayIdPaymentMethodId As String
  
  ' Messaging
  Public EmailDisclaimer As String

  ' User Defined
  Public UserDefinedParameters As ISWsParameters
  Public UserDataJson As String

  ' Permissions
  Public AllowPageGeneral As Boolean
  Public AllowPageOptions As Boolean
  Public AllowPageMessaging As Boolean
  Public AllowPageUserDefined As Boolean

  ' Lists
  Public EmailDisclaimerTagsList As Object
  Public ResourceImageFilter As String
  Public StatesList As String
  
  Public Entities As New List(Of Entity)

  ' Configuration
  Public AddOnBankingAdvanced_Split As Boolean
  Public AddOnCostCentre As Boolean
  Public AddOnSecurityRegister As Boolean
  Public HideOtherPages As Boolean
  Public PromptOnSave As Boolean

End Class



''' &lt;summary&gt;
'''  Entity.
''' &lt;/summary&gt;
Public Class Entity

  Public EntityId As String
  Public PayIdPaymentMethodSqlWhere As String
  
  Public Sub New()
  End Sub
  
  Public Sub New(entityRO As finEntityRO)
    
    With entityRO
      Me.EntityId = .EntityId
      Me.PayIdPaymentMethodSqlWhere = finBLShared.HtmlWidgetUtilities.EncryptSql(finBLShared.PaymentMethods.GetDataViewFilter_PayId(.Pk))
    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</Code>
    <Language>VisualBasic</Language>
    <Notes>System-supplied HTML Widget to edit a Branch.</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;!-- Tabs --&gt;
    &lt;div id="tabDetails" class="is-tabs"&gt;
      &lt;ul&gt;
        &lt;li tabId="General"&gt;General&lt;/li&gt;
        &lt;li tabId="Options"&gt;Options&lt;/li&gt;
        &lt;li tabId="Messaging"&gt;Messaging&lt;/li&gt;
        &lt;li tabId="UserDefined"&gt;User Defined&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:8em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblCodeAndName"&gt;Code and Description&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtBranchId"&gt;Code:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtBranchId"/&gt; &lt;input id="chkActive" type="checkbox"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtDescription"&gt;Description:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtDescription"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;Linked Client&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboClient"&gt;Client:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboClient"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtName"&gt;Name:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtName"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;The Entity this Branch belongs to&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboEntity"&gt;Entity:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboEntity"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblCostCentre"&gt;The Cost Centre this Branch belongs to&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboCostCentre"&gt;Cost Centre:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboCostCentre"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblLogoFileName"&gt;Logo image file names or URLs&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtLogoFileName"&gt;Logo File 1:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtLogoFileName"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtLogoFileName2"&gt;Logo File 2:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtLogoFileName2"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;Resources&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboLogoResource1"&gt;Logo Image:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboLogoResource1"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboOtherResource1"&gt;Other:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboOtherResource1"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblGooglePlaceInformation"&gt;Google Place information&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="txtGooglePlaceId"&gt;Place ID:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="txtGooglePlaceId"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label&gt;Notes&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="txtNotes"/&gt;&lt;/th&gt;
        &lt;/tr&gt;

      &lt;/table&gt;
    &lt;/div&gt;



    &lt;!-- Options --&gt;
    &lt;div id="pageOptions"&gt;
      &lt;table class="is-form"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:8em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblWorkingDayCalendar"&gt;Working day Calendar&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboCalendarWorking"&gt;Calendar:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboCalendarWorking"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblDefaultState"&gt;Default State&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboDefaultState"&gt;State:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboDefaultState"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblSecuredPartyGroup"&gt;Default Secured Party Group&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboSecuredPartyGroup"&gt;SPG:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboSecuredPartyGroup"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblPayID"&gt;Zepto PayID options&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboPayIdPaymentMethod"&gt;Payment&amp;nbsp;Method:&amp;nbsp;&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboPayIdPaymentMethod"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;



    &lt;!-- Messaging --&gt;
    &lt;div id="pageMessaging"&gt;
      &lt;table class="is-form"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:8em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;label id="lblMessaging"&gt;Global Signature or Disclaimer to appear at the bottom of emails&lt;/label&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="txtEmailDisclaimer"/&gt;&lt;/th&gt;
        &lt;/tr&gt;

      &lt;/table&gt;
    &lt;/div&gt;



    &lt;!-- UserDefined --&gt;
    &lt;div id="pageUserDefined"&gt;
      &lt;div id="phUserDefined" style="display:block"&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="cmdFinish" class="is-button ok"&gt;Save&lt;/button&gt;
  &lt;/footer&gt;

&lt;/div&gt;


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

var mOriginalJson;

// Controls
var C = {
  //   General
  lblCodeAndName: null,
  chkActive: null,
  txtBranchId: null,
  txtDescription: null,

  cboClient: null,
  txtName: null,

  cboEntity: null,

  lblCostCentre: null,
  cboCostCentre: null,

  lblLogoFileName: null,
  txtLogoFileName: null,
  txtLogoFileName2: null,

  cboLogoResource1: null,
  cboOtherResource1: null,

  lblGooglePlaceInformation: null,
  txtGooglePlaceId: null,

  txtNotes: null,

  //   Options
  lblWorkingDayCalendar: null,
  cboCalendarWorking: null,

  lblDefaultState: null,
  cboDefaultState: null,

  lblSecuredPartyGroup: null,
  cboSecuredPartyGroup: null,
  
  lblPayID: null,
  cboPayIdPaymentMethod: null,

  //   Messaging
  lblMessaging: null,
  txtEmailDisclaimer: null,

  //   User Defined
  phUserDefined: null,
}

// Form
var frmMain;
var tabDetails;

// Buttons
var cmdCancel;
var cmdFinish;

// Other

// ==========
// Initialise
// ==========
$(function () {
  // --------
  // Controls
  // --------
  //   General
  C.lblCodeAndName = widget.UI.Label("lblCodeAndName", {});
  C.txtBranchId = widget.UI.TextBox("txtBranchId", {
    allowBlank: false,
    maxLength: 10,
    width: widget.UI.FIELD_WIDTH_CODE_10,
  });
  C.chkActive = widget.UI.CheckBox("chkActive", {
    caption: "Active?",
  });
  C.txtDescription = widget.UI.TextBox("txtDescription", {
    allowBlank: false,
    maxLength: 50,
  });

  C.cboClient = widget.UI.DBCombo("cboClient", {
    autoReadOnly: false,
    formKeyOpen: "Clients",
    readOnly: true,
    showDropdown: false,
    width: widget.UI.FIELD_WIDTH_CODE_10,
  });
  C.txtName = widget.UI.TextBox("txtName", {
    allowBlank: false,
    maxLength: 100,
  });

  C.cboEntity = widget.UI.DBCombo("cboEntity", {
    allowBlank: false,
    formKeyOpen: "Entities",
    width: widget.UI.FIELD_WIDTH_CODE_5,
    
    onChange: cboEntity_Change,
  });

  C.lblCostCentre = widget.UI.Label("lblCostCentre", {});
  C.cboCostCentre = widget.UI.DBCombo("cboCostCentre", {
    formKeyOpen: "CostCentres",
    width: widget.UI.FIELD_WIDTH_CODE_10,
  });

  C.lblLogoFileName = widget.UI.Label("lblLogoFileName", {
    tooltipText: "If no path or a partial path is specified, the Logo File Names will be taken as relative to the Templates folder.",
  });
  C.txtLogoFileName = widget.UI.TextBox("txtLogoFileName", {
    maxLength: 255,
  });
  C.txtLogoFileName2 = widget.UI.TextBox("txtLogoFileName2", {
    maxLength: 255,
  });

  C.cboLogoResource1 = widget.UI.DBCombo("cboLogoResource1", {
    formKeyOpen: "Resources",
    width: widget.UI.FIELD_WIDTH_CODE_10,
  });
  C.cboOtherResource1 = widget.UI.DBCombo("cboOtherResource1", {
  formKeyOpen: "Resources",
    width: widget.UI.FIELD_WIDTH_CODE_10,
  });

  C.lblGooglePlaceInformation = widget.UI.Label("lblGooglePlaceInformation", {
    tooltipText: "Use the Place ID to identify this Branch in Google Maps. Use the buttons below to copy, open and get a Place ID.",
  });
  C.txtGooglePlaceId = widget.UI.TextBox("txtGooglePlaceId", {
    maxLength: 200,
  });

  C.txtNotes = widget.UI.TextBox("txtNotes", {
    multiLine: true,
    rows: 6,
  });

  //   Options
  C.lblWorkingDayCalendar = widget.UI.Label("lblWorkingDayCalendar", {
    tooltipText: "If left blank, the values defined for this Branch's Entity will be used."
  });
  C.cboCalendarWorking = widget.UI.DBCombo("cboCalendarWorking", {
    formKeyOpen: "Calendars",
    limitToList: true,
    width: widget.UI.FIELD_WIDTH_CODE_5,
  });

  C.lblDefaultState = widget.UI.Label("lblDefaultState", {});
  C.cboDefaultState = widget.UI.ComboBox("cboDefaultState", {
    maxLength: 50,
    width: "12em",
  });

  C.lblSecuredPartyGroup = widget.UI.Label("lblSecuredPartyGroup", {});
  C.cboSecuredPartyGroup = widget.UI.DBCombo("cboSecuredPartyGroup", {
    formKeyOpen: "SecuredPartyGroups",
    limitToList: true,
    width: widget.UI.FIELD_WIDTH_CODE_10,
  });
  
  C.lblPayID = widget.UI.Label("lblPayID", {});
  C.cboPayIdPaymentMethod = widget.UI.DBCombo("cboPayIdPaymentMethod", {
    limitToList: true,
    width: widget.UI.FIELD_WIDTH_CODE_10,
  });

  //   Messaging
  C.lblMessaging = widget.UI.Label("lblMessaging", {
    tooltipText:"This will appear beneath the User Signature in emails and will replace the Disclaimer defined under Global Settings, Messaging, Email and for the Entity.\n\nClick on the Tags below the text box to insert special tags."  
  });
  C.txtEmailDisclaimer = widget.UI.TextBox("txtEmailDisclaimer", {
    multiLine: true,
    rows: 12,
    maxLength: 8192,
  });

  //   User Defined
  C.phUserDefined = widget.UI.ParametersHost("phUserDefined", {});

  // Grids

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

  // Create Tabs
  tabDetails = new widget.UI.Tabs("tabDetails", {
    style: "normal",
    onSelectedTabChanged: tabDetails_Refresh,
  });

  // Handle resize
  $(window).resize(Form_Resize);

  // Disable Close Button (this causes the 'FormClose' notification action to be invoked instead)
  widget.DisableCloseButton();
  widget.ActionNotificationHandle(Widget_NotificationHandler)

  // Handle Wizard Buttons
  cmdCancel = $("#cmdCancel");
  cmdFinish = $("#cmdFinish");
  cmdCancel.click(tabDetails_Cancel);
  cmdFinish.click(Form_ExecuteAction_Finish);

  // Reset
  Form_Reset();
});

// ==========
// Reset Form
// ==========
function Form_Reset() {
  // 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
    Record_Load_Done,

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

function Record_Load_Done(data) {
  // Initialise
  mRecord = JSON.parse(data);

  // Give Collections ability To lookup by code
  widget.ArrayAllowLookupById(mRecord.Entities, "EntityId");

  // Set Tab
  if (mRecord &amp;&amp; mRecord.PageId) {
    tabDetails.SelectedTabId(mRecord.PageId);

    // Hide other Pages
    if (mRecord.HideOtherPages) {
      tabDetails.ShowSingleTab(mRecord.PageId);
    }
  }
  else {
    tabDetails.SelectedTabId("General");
  }

  // Page Permissions
  if (!mRecord.AllowPageGeneral) tabDetails.TabVisible("General", false);
  if (!mRecord.AllowPageOptions) tabDetails.TabVisible("Options", false);
  if (!mRecord.AllowPageMessaging) tabDetails.TabVisible("Messaging", false);
  if (!mRecord.AllowPageUserDefined) tabDetails.TabVisible("UserDefined", false);

  // Load Fields
  Fields_Load();

  // Save Fields (so UserData is in correct format for mOriginalJson)
  Fields_Save();

  // Save original JSON for Form_IsDirty
  mOriginalJson = JSON.stringify(mRecord);
}

// ===========
// Load Fields
// ===========
function Fields_Load() {
  if (mRecord) {
    // General
    C.txtBranchId.Text(mRecord.BranchId);
    C.chkActive.Value(mRecord.Active);
    C.txtDescription.Text(mRecord.Description);

    C.cboClient.RefreshUnbound(mRecord.ClientId, mRecord.ClientName);
    C.txtName.Text(mRecord.Name);

    C.cboEntity.Text(mRecord.EntityId);

    C.cboCostCentre.Text(mRecord.CostCentreId);

    C.txtLogoFileName.Text(mRecord.LogoFileName);
    C.txtLogoFileName2.Text(mRecord.LogoFileName2);

    C.cboLogoResource1.Text(mRecord.LogoResource1Id);
    C.cboOtherResource1.Text(mRecord.OtherResource1Id);

    C.txtGooglePlaceId.Text(mRecord.GooglePlaceId);

    C.txtNotes.Text(mRecord.Notes);

    // Options
    C.cboCalendarWorking.Text(mRecord.CalendarWorkingId);

    C.cboDefaultState.Text(mRecord.DefaultState);

    C.cboSecuredPartyGroup.Text(mRecord.SecuredPartyGroupId);

    C.cboPayIdPaymentMethod.Text(mRecord.PayIdPaymentMethodId);

    // Messaging
    C.txtEmailDisclaimer.Text(mRecord.EmailDisclaimer);

    // User Defined
    if (mRecord.AllowPageUserDefined) {
      C.phUserDefined.Initialise(mRecord.UserDefinedParameters);
      C.phUserDefined.UpdateParameterValues(JSON.parse(mRecord.UserDataJson));
    }
  }

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

  // Update Controls

  // Update fields
  Fields_Update();

  // Refresh Tab
  tabDetails_Refresh();
  tabDetails_Resize();
}

// ===========
// Save Fields
// ===========
function Fields_Save() {
  // General
  mRecord.BranchId = C.txtBranchId.Text();
  mRecord.Active = C.chkActive.Value();
  mRecord.Description = C.txtDescription.Text();

  mRecord.Name = C.txtName.Text();

  mRecord.EntityId = C.cboEntity.Text();

  mRecord.CostCentreId = C.cboCostCentre.Text();

  mRecord.LogoFileName = C.txtLogoFileName.Text();
  mRecord.LogoFileName2 = C.txtLogoFileName2.Text();

  mRecord.LogoResource1Id = C.cboLogoResource1.Text();
  mRecord.OtherResource1Id = C.cboOtherResource1.Text();

  mRecord.GooglePlaceId = C.txtGooglePlaceId.Text();

  mRecord.Notes = C.txtNotes.Text();

  // Options
  mRecord.CalendarWorkingId = C.cboCalendarWorking.Text();

  mRecord.DefaultState = C.cboDefaultState.Text();

  mRecord.SecuredPartyGroupId = C.cboSecuredPartyGroup.Text();

  mRecord.PayIdPaymentMethodId = C.cboPayIdPaymentMethod.Text();

  // Messaging
  mRecord.EmailDisclaimer = C.txtEmailDisclaimer.Text();

  // User Defined
  if (mRecord.AllowPageUserDefined) {
    mRecord.UserDataJson = JSON.stringify(C.phUserDefined.GetParameterValuesWithTypes());
  }
}

// =============
// Update Fields
// =============
function Fields_Update() {
  // Heading
  if (mRecord) {
    if (mRecord.BranchId) {
      widget.SetHeading("Branch (" + mRecord.BranchId + ")");
    }
    else {
      widget.SetHeading("New Branch");
    }
  }

  // Lists
  if (mRecord) {
    // General
    C.cboEntity.RefreshFromStandardRange("Entities");
    if (mRecord.AddOnCostCentre) C.cboCostCentre.RefreshFromStandardRange("CostCentres");
    C.cboLogoResource1.RefreshFromStandardRange("Resources", mRecord.ResourceImageFilter);
    C.cboOtherResource1.RefreshFromStandardRange("Resources");

    // Options
    C.cboCalendarWorking.RefreshFromStandardRange("Calendars");
    if (mRecord.StatesList) C.cboDefaultState.ListFromCsvString(mRecord.StatesList);
    if (mRecord.AddOnSecurityRegister) C.cboSecuredPartyGroup.RefreshFromStandardRange("SecuredPartyGroups");

    // Messaging
    C.txtEmailDisclaimer.TagsListDefineFromCodeDescriptionList(mRecord.EmailDisclaimerTagsList);
  }

  // Controls
  if (mRecord) {
    // General
    C.cboEntity.ReadOnly(mRecord.Pk != 0);

    if (!mRecord.AddOnCostCentre) {
      C.lblCostCentre.VisibleRow(false);
      C.cboCostCentre.VisibleRow(false);
    }

    // Options
    if (!mRecord.StatesList) {
      C.lblDefaultState.VisibleRow(false);
      C.cboDefaultState.VisibleRow(false);
    }
    if (!mRecord.AddOnSecurityRegister) {
      C.lblSecuredPartyGroup.VisibleRow(false);
      C.cboSecuredPartyGroup.VisibleRow(false);
    }
    if (!mRecord.AddOnBankingAdvanced_Split) {
      C.lblPayID.VisibleRow(false);
      C.cboPayIdPaymentMethod.VisibleRow(false);
    }
  }

  // Pages
  if (mRecord) {
    // NOTE: Even though many pages are updated in tabDetails_Refresh, we must update them here to ensure controls are hidden since this is not a wizard and all pages are validated on "Finish"
    pageGeneral_Refresh();
    pageOptions_Refresh();
    pageMessaging_Refresh();
    pageUserDefined_Refresh();
  }

  // Read-Only?
  if (mRecord &amp;&amp; mRecord.ReadOnly) {
    cmdFinish.prop("disabled", true);
    frmMain.FormReadOnly(C, true);
  }

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

  // Resize Tab
  tabDetails_Resize();
}

// ===========
// Resize Form
// ===========
function Form_Resize() {
  // Mobile Optimisations
  var el = $(".mobile-indent th.indent1, .mobile-indent th.no-indent1");
  if (window.innerWidth &lt; 500) {
    el.addClass("no-indent1").removeClass("indent1");
  }
  else {
    el.addClass("indent1").removeClass("no-indent1");
  }

  // General

  // Tab
  tabDetails_Resize();
}

// ========
// Is Dirty
// ========
function Form_IsDirty() {
  if (mRecord) {
    // Save Fields
    Fields_Save();

    // Is Dirty?
    return mOriginalJson != JSON.stringify(mRecord);
  }
  else {
    return false;
  }
}

// ==============
// Wizard Buttons
// ==============
function tabDetails_Cancel() {
  if (Form_IsDirty()) {
    // Confirm
    widget.UI.MsgBoxConfirm("Are you sure you want to close this form without saving your changes?", { heading: "Close Form" }, tabDetails_Cancel_Finalise);
  }
  else {
    // Cancel immediately
    tabDetails_Cancel_Finalise();
  }
}

function tabDetails_Cancel_Finalise() {
  if (widget.CanClose()) {
    widget.Close();
  }
  else {
    widget.Reset();
  }
}

// ==========
// Resize Tab
// ==========
function tabDetails_Resize() {
  switch (tabDetails.SelectedTabId()) {
    case "General":
      // General
      C.txtDescription.WidthResizeFromParent();
      C.txtName.WidthResizeFromParent();
      C.txtLogoFileName.WidthResizeFromParent();
      C.txtLogoFileName2.WidthResizeFromParent();
      C.txtGooglePlaceId.WidthResizeFromParent();
      C.txtNotes.WidthResizeFromParent();
      break;

    case "Options":
      // Options
      break;

    case "Messaging":
      // Messaging
      break;

    case "UserDefined":
      // User Defined
      C.phUserDefined.ResizeFromParent();
      break;
  }
}

// ===========
// Refresh Tab
// ===========
function tabDetails_Refresh() {
   // Load details
  switch (tabDetails.SelectedTabId()) {
    case "General":
      pageGeneral_Refresh();
      break;

    case "Options":
      pageOptions_Refresh();
      break;

    case "Messaging":
      pageMessaging_Refresh();
      break;

    case "UserDefined":
      pageUserDefined_Refresh();
      break;

    default:
      break;
  }

  // Resize
  tabDetails_Resize();

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

// =================
// Execute an Action
// =================
function Form_ExecuteAction(actionId, data) {
  switch(actionId) {
    default:
      window.alert("Unhandled action '" + actionId + "'");
  }
}

// =============
// Finish Action
// =============
function Form_ExecuteAction_Finish() {
  // Assume Success
  var Ok = true;

  // Validate
  Ok = tabDetails.Validate();

  // Prompt
  if (Ok) {
    if (mRecord.PromptOnSave) {
      // Confirm
      widget.UI.MsgBoxConfirm("Are you sure you want to save this record?",
                              { heading: "Save" },
                              Form_ExecuteAction_FinishPost);

    }
    else {
      // Save without prompting
      Form_ExecuteAction_FinishPost();
    }
  }
}

function Form_ExecuteAction_FinishPost() {
  // Disable Form
  widget.UI.Block("Saving, please wait...");

  // Create Parameters
  // NOTE: We will simply update mRecord, clone this and send back (less some information)
  Fields_Save();
  var params = JSON.parse(JSON.stringify(mRecord));
  //params.GendersList = null;

  // Finish
  widget.GetString("Finish", params,
    function (data) {
      // Close Form
      widget.Close();

      // Refresh Parent (to show updated details)
      // NOTE: Pass in Record Id just in case this has changed
      widget.RefreshParent(C.txtBranchId.Text());
    },

    function (data) {
      // Show Error
      widget.UI.MsgBoxAlert(data);

      // Enable Form
      widget.UI.Unblock();
    }
  );
}

// ===========
// pageGeneral
// ===========
function pageGeneral_Refresh() {
  if (!mRecord) return;

  // Controls
}

// ===========
// pageOptions
// ===========
function pageOptions_Refresh() {
  if (!mRecord) return;

  // Reset Controls
  C.cboPayIdPaymentMethod.RefreshFromCollection([]);

  // Update Controls
  if (mRecord.AddOnBankingAdvanced_Split) {
    var entity = mRecord.Entities.GetItem(C.cboEntity.Text());
    if (entity) {
      C.cboPayIdPaymentMethod.RefreshFromStandardRange("PaymentMethods", entity.PayIdPaymentMethodSqlWhere);
    }
  }  
}

// =============
// pageMessaging
// =============
function pageMessaging_Refresh() {
  if (!mRecord) return;

  // Controls
}

// ===============
// pageUserDefined
// ===============
function pageUserDefined_Refresh() {
  if (!mRecord) return;

  // Controls
}

// =========
// cboEntity
// =========
function cboEntity_Change(sender, e) {
  // Handled
  if (e) e.ChangeHandled = true;    
  
  // Update Controls
  if (e &amp;&amp; mRecord.AddOnBankingAdvanced_Split) C.cboPayIdPaymentMethod.Text("");
}

// ====================
// Notification Handler
// ====================
function Widget_NotificationHandler(actionId, data) {
   switch(actionId) {
     case "FormClose":
      // Form Close button is disabled so act as if 'Cancel' has been clicked
      tabDetails_Cancel();
      break;
   }
}
&lt;/script&gt;</TemplateText>
    <TemplateTextBookmarks />
    <TimeoutSeconds>60</TimeoutSeconds>
    <UniqueId>wTAyxOcWk0izLN86NxXONg</UniqueId>
    <AllowRefresh>true</AllowRefresh>
    <Caption>Branch</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>Branch</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 />
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="HideOtherPages" type="Boolean">
            <BlankTip />
            <Caption>Hide pages other than the one being edited?</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value>True</Value>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>Configuration options.</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>TESTING</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="BranchId" type="Range">
            <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>
            <LimitToList>false</LimitToList>
            <MaxLength>10</MaxLength>
            <RangeSingle>true</RangeSingle>
            <RangeType>Standard</RangeType>
            <RangeLookupSource>Branches</RangeLookupSource>
            <RangeLookupSqlWhere />
          </Parameter>
          <Parameter name="DuplicateRecordId" 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="Page" 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>General,Filters</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="ReadOnly" type="Boolean">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value>False</Value>
            <Visible>true</Visible>
          </Parameter>
        </Parameters>
      </ISParameterDefs>
    </Parameters>
  </finScript>