<?xml version="1.0" encoding="utf-8"?>
  <finScript version="1.00" exportedUtcDate="2024-09-20T02:24:46.0000000">
    <CreatedUserId>ADMIN</CreatedUserId>
    <CreatedUtcDate>2024-05-15T23:32:56.7820000</CreatedUtcDate>
    <UpdatedUserId>ADMIN</UpdatedUserId>
    <UpdatedUtcDate>2024-09-20T02:24:15.2490000</UpdatedUtcDate>
    <ScriptId>HWADA</ScriptId>
    <Description>Accept or Decline Account</Description>
    <ScriptType>HtmlWidget</ScriptType>
    <Active>true</Active>
    <AllowUI>false</AllowUI>
    <Bookmarks />
    <Category />
    <Code>' HtmlWidget_AccountAcceptDecline
Option Explicit On
Option Strict On

' #################################################################
' Accept or Decline Account wizard HTML Widget
'
' Version: 1.08 (20/09/2024)
'
' Usage: System-defined HTML Widget
' #################################################################
' Version        Date  User     Job       Description
' -------  ----------  -------  --------  -------------------------
'    1.07  28/02/2023  ISS      J030539   Hide content while loading
'    1.08  20/09/2024  ISS      J034225   Updated the Unwanted and Decline warnings for Account Applications
' #################################################################

' Constants
Private Const FORM_KEY As String = "AccountAcceptDecline"

' Common Parameters
Private mAccountId As String
Private mAction As String

' 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
    mAccountId = .GetString("AccountId")
    mAction = .GetString("Action")
  End With

  ' Handle Events
  Select Case eventId
    Case ""
      ' Main event, i.e., return initial HTML content (excluding html and body tags)
      returnValue = Replace(ScriptInfo.TemplateText, "&lt;%[RecordId]%&gt;", mAccountId)

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

    Case "GetInitialisationInfo"
      ' Get Initialisation Information required for this wizard
      Main = GetInitialisationInfo(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 Account As finAccount
  Dim FormInitialisationInfo As FormInitialisationInfo
  Dim strTemp As String
  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Validate
  If Len(mAccountId) = 0 Then
    Success = False
    finBL.Error.ErrorBegin("Account Id not specified.")
  ElseIf finBL.CurrentUserInformation.IsAccountFilteredOut(mAccountId) Then
    Success = False
    finBL.Error.ErrorBegin("You do not have permission to view this record.")
  ElseIf finBL.Database.IsReadOnly Then
    Success = False
    finBL.Error.ErrorBegin("Access denied. Database is Read-Only.")
  End If

  ' Load Account
  If Success Then
    Account = finBL.CreateAccount()
    Success = Account.Load(mAccountId)
  End If

  ' Get Initialisation Info
  If Success Then
    FormInitialisationInfo = New FormInitialisationInfo()
    With FormInitialisationInfo
      ' Record
      .RecordId = Account.AccountId
      .RecordDescription = Account.Name

      ' General
      .AuthorisedByUserId = finBL.CurrentUser.UserId
      .DateAccepted = finBL.HtmlWidgetUtilities.GetNullableJsonUtcDateFromDatabaseDate(finBL.TimeZoneFunctions.GetCurrentDatabaseDate())
      .DateDeclined = .DateAccepted
      .DateSigned = finBL.HtmlWidgetUtilities.GetNullableJsonUtcDateFromDatabaseDate(Account.DateSigned)
      .DateQuoted = finBL.HtmlWidgetUtilities.GetNullableJsonUtcDateFromDatabaseDate(Account.DateQuoted)

      ' Account Summary
      .AccountSummaryHtml = finBL.SummaryPageFunctions.AccountSummary(False, Account, CreateScriptContextData())

      ' Permissions
      .CanAccept = Account.CanUpdateStatusQuoteToOpen(strTemp)
      .CanAcceptWarning = strTemp
      .CanDecline = Account.CanUpdateStatusQuoteToDecline()
      .CanUnwanted = Account.CanUpdateStatusQuoteToUnwanted()

      ' Default Action
      Select Case UCase(mAction)
        Case "ACCEPT": If .CanAccept Then .Action = "Accept"
        Case "DECLINE": If .CanDecline Then .Action = "Decline"
        Case "UNWANTED": If .CanUnwanted Then .Action = "Unwanted"
      End Select

      ' Warnings
      If Account.AccountApps.Count &lt;&gt; 0 Then
        .DeclineWarning = "This will decline the Account Application and delete the Account. However, it can still be viewed as a 'Declined' (archived) Account for the Client(s)."
        .UnwantWarning = "This will set the Account Application to unwanted and delete the Account. However, it can still be viewed as an 'Unwanted' (archived) Account for the Client(s)."
      Else If Account.AccountType.OptionArchiveDeclinedUnwanted Then
        .DeclineWarning = "This will delete the Account, but it can still be viewed as a 'Declined' (archived) Account for the Client(s)."
        .UnwantWarning = "This will delete the Account, but it can still be viewed as an 'Unwanted' (archived) Account for the Client(s)."
      End If

      ' Lists
      If .CanUnwanted Then
        .AuthorisedByNameList = finBL.AccountFunctions.GetByWhomList(Account, True, False, True).ToCsvString()
      End If

      ' Configuration
      .PromptOnCommit = finBL.CloudConnectFunctions.CloudConnectSettings.PromptOnCommit
    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

  CreateScriptContextData = finBL.CreateKeyValueList()
  With CreateScriptContextData
    .SetObject("Target", ScriptInfo.Target)
    .SetBoolean("HighDpi", finBL.HighDpi)
    .SetString("FormKey", FORM_KEY)
    .SetString("FormRecordMode", iseFormRecordMode.Loaded.ToString())
  End With

End Function

''' &lt;summary&gt;
'''  Create a finAccountAcceptDecline object from Web Service properties.
''' &lt;/summary&gt;
''' &lt;returns&gt;
'''  A Boolean value indicating success.
''' &lt;/returns&gt;
Private Function CreateAccountAcceptDecline(accountId As String,
                                            parameters As WizardFinishParameters,
                                            ByRef accountAcceptDecline As finAccountAcceptDecline) As Boolean

  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Initialise
  accountAcceptDecline = finBL.CreateAccountAcceptDecline()

  ' Update
  With AccountAcceptDecline
    ' Load Account
    Success = .AccountLoad(accountId)

    ' Update
    If Success AndAlso parameters IsNot Nothing Then
      ' General
      Select Case UCase(parameters.AccountAcceptStatus)
        Case "ACCEPT" : .AccountAcceptStatus = isefinAccountAcceptStatus.Accept
        Case "DECLINE" : .AccountAcceptStatus = isefinAccountAcceptStatus.Decline
        Case "UNWANTED" : .AccountAcceptStatus = isefinAccountAcceptStatus.Unwanted
      End Select

      ' Accepted
      .DateAccepted = finBL.HtmlWidgetUtilities.GetDatabaseDateFromJsonUtcDate(parameters.DateAccepted)
      .DateSigned = finBL.HtmlWidgetUtilities.GetDatabaseDateFromJsonUtcDate(parameters.DateSigned)

      ' Decline/ Unwanted
      .AuthorisedName = parameters.AuthorisedName
      .AuthorisedReason = parameters.AuthorisedReason
      .CloseNote = parameters.CloseNote
      .DateDeclined = finBL.HtmlWidgetUtilities.GetDatabaseDateFromJsonUtcDate(parameters.DateDeclined)
    End If
  End With

  Return Success

End Function

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

  Dim AccountAcceptDecline As finAccountAcceptDecline
  Dim AccountArchived As Boolean
  Dim obj As Object
  Dim Success As Boolean
  Dim WizardFinishParameters As WizardFinishParameters

  ' Assume Success
  Success = True

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

  ' Create Accept Decline object
  If Success Then
    Success = CreateAccountAcceptDecline(WizardFinishParameters.AccountId, WizardFinishParameters, AccountAcceptDecline)
  End If

  ' Execute
  If Success Then
    With AccountAcceptDecline
      Select Case .AccountAcceptStatus
        Case isefinAccountAcceptStatus.Accept : Success = .ExecuteAccept()
        Case isefinAccountAcceptStatus.Decline : Success = .ExecuteDecline(AccountArchived)
        Case isefinAccountAcceptStatus.Unwanted : Success = .ExecuteUnwanted(AccountArchived)
      End Select
    End With
  End If

  ' Finalise
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(New WizardFinishDetails(AccountArchived), 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 AccountAcceptDecline As finAccountAcceptDecline
  Dim AccountWarning As finAccountWarning
  Dim Data As Object
  Dim FailedControlId As String
  Dim FailedMessage As String
  Dim PageId As String
  Dim Success As Boolean
  Dim Warnings As List(Of Warning)

  ' 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"
      ' Load Warnings
      If CreateAccountAcceptDecline(mAccountId, Nothing, AccountAcceptDecline) Then
        Success = AccountAcceptDecline.AccountWarningsLoad()

        ' Get Warnings
        If AccountAcceptDecline.AccountWarnings.Count &lt;&gt; 0 Then
          Warnings = New List(Of Warning)
          For Each AccountWarning In AccountAcceptDecline.AccountWarnings
            Warnings.Add(New Warning(AccountWarning))
          Next
          Data = Warnings
        End If
      Else
        Success = False
      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;
'''  Wizard Initialisation Information.
''' &lt;/summary&gt;
Public Class FormInitialisationInfo

  ' Record
  Public RecordId As String
  Public RecordDescription As String

  ' General
  Public Action As String
  Public AuthorisedByUserId As String
  Public DateAccepted As Date?
  Public DateDeclined As Date?
  Public DateQuoted As Date?
  Public DateSigned As Date?

  ' Account Summary
  Public AccountSummaryHtml As String

  ' Permissions
  Public CanAccept As Boolean
  Public CanAcceptWarning As String  ' A warning to display if the Account cannot be accepted, e.g., due to Permissions
  Public CanDecline As Boolean
  Public CanUnwanted As Boolean

  ' Warnings
  Public DeclineWarning As String
  Public UnwantWarning As String

  ' Lists
  Public AuthorisedByNameList As String

  ' Configuration
  Public PromptOnCommit As Boolean

End Class


''' &lt;summary&gt;
'''  Account Warning.
''' &lt;/summary&gt;
Public Class Warning

  ' Properties
  Public ClientId As String
  Public ClientName As String
  Public Details As String
  Public DetailsIsHtml As Boolean
  Public Severity As isefinAccountWarningSeverity
  Public Summary As String

  ' Other Properties
  Private Accept As Boolean

  Public Sub New(accountWarning As finAccountWarning)

    With accountWarning
      Me.ClientId = .ClientId
      Me.ClientName = .ClientName
      Me.Details = .Details
      Me.DetailsIsHtml = .DetailsIsHtml
      Me.Severity = .Severity
      Me.Summary = .Summary
    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 AccountId As String
  Public AccountAcceptStatus As String

  ' Accept
  Public DateAccepted As Date?
  Public DateSigned As Date?

  ' Decline/ Unwanted
  Public DateDeclined As Date?
  Public AuthorisedName As String
  Public CloseNote As String
  Public AuthorisedReason As String

End Class


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

  Public AccountArchived As Boolean

  Public Sub New(accountArchived As Boolean)

    Me.AccountArchived = accountArchived

  End Sub

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

Used as a finPOWER Connect Cloud compatible version of the form "AccountAcceptDecline".</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="Select the action to be taken for the Account."&gt;Account&lt;/li&gt;
        &lt;li tabId="Warnings" tooltipText="Review and accept all warnings to continue."&gt;Warnings&lt;/li&gt;
        &lt;li tabId="Confirm"&gt;Confirm&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:7em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblAccount"&gt;Account&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboRecord"&gt;Account:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboRecord" /&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblAction"&gt;Select the Action to be taken&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkActionAccept" type="checkbox" /&gt; &lt;span id="spnCanAcceptWarning" class="is-info-text warning small"&gt;&lt;/span&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkActionDecline" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th colspan="2"&gt;&lt;input id="chkActionUnwanted" type="checkbox" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;


    &lt;!-- Warnings --&gt;
    &lt;div id="pageWarnings"&gt;
      &lt;table class="is-form" style="height:100%"&gt;
        &lt;tr style="height:100%"&gt;
          &lt;th colspan="2" style="height:100%"&gt;&lt;div id="gridWarnings" style="height:100%"&gt;&lt;/div&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;


    &lt;!-- Confirm --&gt;
    &lt;div id="pageConfirm"&gt;
      &lt;table class="is-form" style="height:100%"&gt;
        &lt;colgroup&gt;
          &lt;col style="width:7em" /&gt;
          &lt;col /&gt;
        &lt;/colgroup&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblConfirmDate"&gt;Specify date...&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="dateDeclined"&gt;Date:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="dateDeclined" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboAuthorisedByUser"&gt;By Whom:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboAuthorisedByUser" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboAuthorisedBy"&gt;By Whom:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboAuthorisedBy" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="cboCloseNotes"&gt;Notes:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="cboCloseNotes" /&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;th&gt;&lt;label for="dateQuoted"&gt;Quoted:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="dateQuoted" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="dateAccepted"&gt;Accepted:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="dateAccepted" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;th&gt;&lt;label for="dateSigned"&gt;Signed:&lt;/label&gt;&lt;/th&gt;
          &lt;td&gt;&lt;input id="dateSigned" /&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblReason"&gt;Reason&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr style="height:100%"&gt;
          &lt;th colspan="2" style="height:100%"&gt;&lt;input id="txtReason"/&gt;&lt;/th&gt;
        &lt;/tr&gt;

        &lt;tr&gt;&lt;th colspan="2"&gt;&lt;label id="lblAccountSummary"&gt;Account Summary&lt;/label&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;tr style="height:100%"&gt;
          &lt;th colspan="2" style="height:100%"&gt;&lt;div id="wbAccountSummary" class="is-dock-fill"&gt;&lt;/div&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/table&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;
// Server-side information
var mRecordId = "&lt;%[RecordId]%&gt;";

// Properties
var mRecord;
var mRecord_Warnings;

// Controls
var C = {
  // General
  lblAccount: null,
  cboRecord: null,

  lblAction: null,
  chkActionAccept: null,
  spnCanAcceptWarning: null,
  chkActionDecline: null,
  chkActionUnwanted: null,

  // Warnings
  gridAccountWarnings: null,

  // Confirm
  lblConfirmDate: null,
  dateDeclined: null,
  cboAuthorisedByUser: null,
  cboAuthorisedBy: null,
  cboCloseNotes: null,

  lblReason: null,
  txtReason: null,

  dateQuoted: null,
  dateAccepted: null,
  dateSigned: null,

  lblAccountSummary: null,
  wbAccountSummary: null,
}

// Form
var frmMain;
var tabWizard;

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

// ==========
// Initialise
// ==========
$(function () {

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

  C.lblAction = widget.UI.Label("lblAction", {});
  C.chkActionAccept = widget.UI.CheckBox("chkActionAccept", {
    caption: "Accept",
    cssClass: "is-radio-button",
    onChange: chkAction_Change
  });
  C.spnCanAcceptWarning = $("#spnCanAcceptWarning");
  C.chkActionDecline = widget.UI.CheckBox("chkActionDecline", {
    caption: "Decline",
    cssClass: "is-radio-button",
    onChange: chkAction_Change
  });
  C.chkActionUnwanted = widget.UI.CheckBox("chkActionUnwanted", {
    caption: "Unwanted",
    cssClass: "is-radio-button",
    onChange: chkAction_Change
  });

  //   Warnings
  C.gridWarnings = widget.UI.Grid("gridWarnings", {
    rowNumbering: true,
    stickyHeader: true,
    onBeforeCellUpdate: gridWarnings_BeforeCellUpdate,
    onInitialiseRow: gridWarnings_InitialiseRow,
  });
  C.gridWarnings.AddColumnIcon("Icon", {});
  C.gridWarnings.AddColumnBoolean("Accept", { caption: "Accept", width: "3em", allowEdit: true});
  C.gridWarnings.AddColumnCode("ClientId", { caption: "Client", width: "6em"});
  C.gridWarnings.AddColumnString("ClientName", { caption: "Name", width: "16em", truncate: true});
  C.gridWarnings.AddColumnString("Summary", { caption: "Summary"});

  //   Confirm
  C.lblConfirmDate = widget.UI.Label("lblConfirmDate", {});
  C.dateDeclined = widget.UI.DateBox("dateDeclined", {
    allowBlank: false,
  });
  C.cboAuthorisedByUser = widget.UI.DBCombo("cboAuthorisedByUser", {
    allowBlank: false,
    width: widget.UI.FIELD_WIDTH_CODE_20
  });
  C.cboAuthorisedBy = widget.UI.ComboBox("cboAuthorisedBy", {
    allowBlank: false,
    maxLength: 50,
  });
  C.cboCloseNotes = widget.UI.InformationListComboBox("cboCloseNotes", {
    maxLength: 50,
  });

  C.lblReason = widget.UI.Label("lblReason", {});
  C.txtReason = widget.UI.TextBox("txtReason", {
    multiLine: true,
    maxLength: 1024
  });

  C.dateQuoted = widget.UI.DateBox("dateQuoted", {
    readOnly: true,
  });
  C.dateAccepted = widget.UI.DateBox("dateAccepted", {
    allowBlank: false,
  });
  C.dateSigned = widget.UI.DateBox("dateSigned", {
    allowBlank: true,
  });

  C.lblAccountSummary = widget.UI.Label("lblAccountSummary", {});
  C.wbAccountSummary = widget.UI.PreviewPane("wbAccountSummary", {});

  // Create Widget form
  // NOTE: Hide by default for a cleaner startup
  frmMain = new widget.UI.Form("frmMain", { captionWidth: "9em", textboxWidth: "20em", 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"); });

  // Reset
  Form_Reset();
});

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

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

  // Resize
  Form_Resize();

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

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

  // Hide content
  frmMain.Visible(false);

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

  // Load Initialisation details
  var params = {recordId: mRecordId};
  widget.GetString("GetInitialisationInfo", params,
    // Success
    function (data) {
      mRecord = JSON.parse(data);
      Fields_Load();
    },

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

// ===========
// Load Fields
// ===========
function Fields_Load() {
  if (mRecord) {
    // General
    C.cboRecord.RefreshUnbound(mRecord.RecordId, mRecord.RecordDescription);

    // Warnings

    // General
    C.cboAuthorisedByUser.Text(mRecord.AuthorisedByUserId);
    C.dateQuoted.Value(mRecord.DateQuoted);
    C.dateSigned.Value(mRecord.DateSigned);
    C.dateAccepted.Value(mRecord.DateAccepted);
    C.dateDeclined.Value(mRecord.DateDeclined);

    // Default Action
    switch(mRecord.Action)
    {
      case "Accept":
        chkAction_Change(C.chkActionAccept);
        break;

      case "Decline":
        chkAction_Change(C.chkActionDecline);
        break;

      case "Unwanted":
        chkAction_Change(C.chkActionUnwanted);
        break;
    }
  }

  // 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() {
  // Information Lists

  // Controls
  C.chkActionAccept.ReadOnly(!mRecord.CanAccept);
  C.chkActionDecline.ReadOnly(!mRecord.CanDecline);
  C.chkActionUnwanted.ReadOnly(!mRecord.CanUnwanted);
  C.spnCanAcceptWarning.text(mRecord.CanAcceptWarning);

  // Update Buttons
  tabWizard_UpdateButtons();

  // Read-Only?
  if (mRecord &amp;&amp; mRecord.ReadOnly) frmMain.FormReadOnly(C, true);

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

  // Resize Tab
  tabWizard_Resize();
}

// ===========
// Resize Form
// ===========
function Form_Resize() {
  // General

  // Tab
  tabWizard_Resize();
}

// ==============
// Wizard Buttons
// ==============
function tabWizard_Cancel() {
  if (widget.CanClose()) {
    widget.Close();
  }
  else {
    widget.Reset();
  }
}

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"));
  cmdFinish.attr("class", "is-button");
  if (C.chkActionAccept.Value()) {
    cmdFinish.text("Accept");
    cmdFinish.addClass("positive");
  }
  else if (C.chkActionDecline.Value()) {
    cmdFinish.text("Decline");
    cmdFinish.addClass("negative");
  }
  else {
    cmdFinish.text("Unwanted");
    cmdFinish.addClass("ok");
  }
}

// ==========
// Resize Tab
// ==========
function tabWizard_Resize() {
  switch (tabWizard.SelectedTabId()) {
    case "General":
      C.cboRecord.WidthResizeFromParent();
      break;

    case "Warnings":
      break;

    case "Confirm":
      C.cboAuthorisedByUser.WidthResizeFromParent();
      C.cboAuthorisedBy.WidthResizeFromParent();
      C.cboCloseNotes.WidthResizeFromParent();
      C.txtReason.ResizeFromParent();
      C.wbAccountSummary.ResizeFromParent();
      break;

    default:
      break;
  }
}

// ===========
// Wizard Move
// ===========
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)) {
        case "Warnings":
          if (C.chkActionAccept.Value() &amp;&amp; mRecord_Warnings &amp;&amp; mRecord_Warnings.length != 0) {
            found = true;
          }
          break;

        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);
  }
}

// ===========
// Refresh Tab
// ===========
function tabWizard_Refresh(newTab) {
  // Moving forward onto tab, so Load information
  if (newTab &gt;= tabWizard.SelectedTabIndex()) {
    switch (tabWizard.GetTabIdByIndex(newTab)) {
      case "Warnings":
        // Warnings
        C.gridWarnings.VirtualDataRefresh(mRecord_Warnings);
        break;

      case "Confirm":
        // Confirm
        if (C.chkActionAccept.Value()) {
          // Accept
          C.lblConfirmDate.Text("Specify the date this Account was accepted and signed");
          C.dateDeclined.VisibleRow(false);
          C.cboAuthorisedByUser.VisibleRow(false);
          C.cboAuthorisedBy.VisibleRow(false);
          C.cboCloseNotes.VisibleRow(false);
          C.lblReason.VisibleRow(false);
          C.txtReason.VisibleRow(false);

          C.dateQuoted.VisibleRow(true);
          C.dateAccepted.VisibleRow(true);
          C.dateSigned.VisibleRow(true);

          C.lblAccountSummary.VisibleRow(true);
          C.wbAccountSummary.VisibleRow(true);
          C.wbAccountSummary.SetContent(mRecord.AccountSummaryHtml, false);
        }
        else if (C.chkActionDecline.Value()) {
          // Decline
          C.lblConfirmDate.Text("Specify the date and person who declined this 'Quote' Account");
          C.dateDeclined.VisibleRow(true);
          C.cboCloseNotes.SetComboFromInformationList("AccountCloseNoteDeclined", false, null, true);
          C.cboCloseNotes.VisibleRow(true);
          C.cboAuthorisedByUser.VisibleRow(true);
          C.cboAuthorisedByUser.RefreshFromStandardRange("AccountAuthorisers");
          C.cboAuthorisedBy.VisibleRow(false);
          C.lblReason.VisibleRow(true);
          C.txtReason.VisibleRow(true);

          C.dateQuoted.VisibleRow(false);
          C.dateAccepted.VisibleRow(false);
          C.dateSigned.VisibleRow(false);

          C.lblAccountSummary.VisibleRow(false);
          C.wbAccountSummary.VisibleRow(false);
        }
        else {
          // Unwanted
          C.lblConfirmDate.Text("Specify details about this unwanted 'Quote' Account");
          C.dateDeclined.VisibleRow(true);
          C.cboAuthorisedByUser.VisibleRow(false);
          C.cboAuthorisedBy.ListFromCsvString(mRecord.AuthorisedByNameList);
          C.cboAuthorisedBy.VisibleRow(true);
          C.cboCloseNotes.SetComboFromInformationList("AccountCloseNoteUnwanted", false, null, true);
          C.cboCloseNotes.VisibleRow(true);
          C.lblReason.VisibleRow(true);
          C.txtReason.VisibleRow(true);

          C.dateQuoted.VisibleRow(false);
          C.dateAccepted.VisibleRow(false);
          C.dateSigned.VisibleRow(false);

          C.lblAccountSummary.VisibleRow(false);
          C.wbAccountSummary.VisibleRow(false);
        }
        break;

      default:
        break;
    }
  }

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

  // Tweak fields

  // Update Heading
  switch (tabWizard.SelectedTabId()) {
    case "Confirm":
      if (C.chkActionAccept.Value()) {
        frmMain.RefreshHeading("Accept", "Account '" + mRecord.RecordId + "', " + mRecord.RecordDescription + ".");
      }
      else if (C.chkActionDecline.Value()) {
        frmMain.RefreshHeading("Decline", "Account '" + mRecord.RecordId + "', " + mRecord.RecordDescription + ".");
      }
      else {
        frmMain.RefreshHeading("Unwanted", "Account '" + mRecord.RecordId + "', " + mRecord.RecordDescription + ".");
      }
      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;
  }
}

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

  // Other client-side validation
  if (Ok) {
    switch (tabWizard.SelectedTabId()) {
      case "General":
        // General
        if (!C.chkActionAccept.Value() &amp;&amp; !C.chkActionDecline.Value() &amp;&amp; !C.chkActionUnwanted.Value()) {
          Ok = false;
          if (mRecord.CanAccept) {
            C.chkActionAccept.Focus();
          }
          else {
            C.chkActionDecline.Focus();
          }
          widget.UI.MsgBoxAlert("You must select whether to Accept, Decline or flag this Account as Unwanted.");
        }
        break;

      case "Warnings":
        // Warnings
        if (CountFails() != 0) {
          Ok = false;
          widget.UI.MsgBoxAlert("This Account has 'Fail' warnings and cannot be accepted.");
        }
        else if (CountToAccept() != 0) {
          Ok = false;
          widget.UI.MsgBoxAlert("You must accept all warnings to continue.");
        }
        break;

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

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

    switch (tabWizard.SelectedTabId()) {
      case "General":
        // General
        if (C.chkActionAccept.Value()) {
          //params = { accountId: mRecord.RecordId };
          params = {};
        }
        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":
          mRecord_Warnings = o.Data;
          break;
    }

    // Callback
    validCallback();
  }
}

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

  // Enable form
  frmMain.FormEnable();
}

// =========
// chkAction
// =========
function chkAction_Change(sender) {
  C.chkActionAccept.Value(sender === C.chkActionAccept);
  C.chkActionDecline.Value(sender === C.chkActionDecline);
  C.chkActionUnwanted.Value(sender === C.chkActionUnwanted);

  // Update Buttons
  tabWizard_UpdateButtons();
}

// ============
// gridWarnings
// ============
function gridWarnings_InitialiseRow(e) {
  var item = mRecord_Warnings[e.row.listIndex];

  // Update cells
  e.row.cells.Accept.value = item.Accept;
  e.row.cells.ClientId.value = item.ClientId;
  e.row.cells.ClientName.value = item.ClientName;
  e.row.cells.Summary.value = item.Summary;

  // Severity
  switch (item.Severity) {
    case "Alert":
      e.row.cells.Icon.value = "Warning";
      e.row.cells.Accept.readOnly = false;
      break;

    case "Fail":
      e.row.cells.Icon.value = "Error";
      e.row.cells.Accept.readOnly = true;
      break;

    case "Information":
      e.row.cells.Icon.value = "Information";
      e.row.cells.Accept.readOnly = true;
      break;
  }

  // Cell hyperlinks
  if (item.ClientId) {
    e.row.cells.ClientId.hyperlink = "app://formshow?form=Client&amp;id=" + encodeURI(item.ClientId);
  }
}

function gridWarnings_BeforeCellUpdate(e) {
  var item = mRecord_Warnings[e.row.listIndex];

  switch (e.columnKey) {
    case "Accept":
      item.Accept = e.newValue;
      break;
  }

  // No need to refresh this row
  e.refreshRow = false;
}

function CountFails() {
  var count = 0;
  for (var i = 0; i &lt; mRecord_Warnings.length; i++) {
    var item = mRecord_Warnings[i];
    if (item.Severity == "Fail") {
      count += 1;
    }
  }

  return count;
}

function CountToAccept() {
  var count = 0;
  for (var i = 0; i &lt; mRecord_Warnings.length; i++) {
    var item = mRecord_Warnings[i];
    if (item.Severity == "Alert" &amp;&amp; !item.Accept) {
      count += 1;
    }
  }

  return count;
}

// =================
// 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() {
  // Validate
  tabWizard_Validate(function () {
    if (mRecord.PromptOnCommit) {
      // Confirm
      var message;
      var heading;
      if (C.chkActionAccept.Value()) {
        heading = "Accept";
        message = "Are you sure you want to accept and open this Account?";
      }
      else if (C.chkActionDecline.Value()) {
        heading = "Decline";
        message = "Are you sure you want to decline this Account?";
        if (mRecord.DeclineWarning) message += "\n\n" + mRecord.DeclineWarning;
      }
      else {
        heading = "Unwanted";
        message = "Are you sure you want to update this Account to unwanted?";
        if (mRecord.UnwantWarning) message += "\n\n" + mRecord.UnwantWarning;
      }
      widget.UI.MsgBoxConfirm(message, { heading: heading }, function () { Form_ExecuteAction_FinishPost(); }, null);
    }
    else {
      // Commit without prompting
      Form_ExecuteAction_FinishPost();
    }
  });
}

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

  // Create Parameters
  var params = {
    // General
    AccountId: mRecordId,

    // Accept
    DateAccepted: C.dateAccepted.Value(),
    DateSigned: C.dateSigned.Value(),

    // Decline/ Unwanted
    DateDeclined: C.dateDeclined.Value(),
    CloseNote: C.cboCloseNotes.Text(),
    AuthorisedReason: C.txtReason.Text(),
  };
  if (C.chkActionAccept.Value()) {
    params.AccountAcceptStatus = "Accept";
  }
  else if (C.chkActionDecline.Value()) {
    params.AccountAcceptStatus = "Decline";
    params.AuthorisedName = C.cboAuthorisedByUser.Text();
  }
  else {
    params.AccountAcceptStatus = "Unwanted";
    params.AuthorisedName = C.cboAuthorisedBy.Text();
  }

  // Finish
  widget.GetString("Finish", params,
    function (data) {
      data = JSON.parse(data);

      // Close Form
      widget.Close();

      // Refresh Parent (to show updated status)
      if (data.AccountArchived &amp;&amp; widget.GetHostingContext() == "HtmlViewer") {
        // Account was Archived and no longer exists so prevent finPOWER Connect from refreshing which will show a warning
      }
      else {
        widget.RefreshParent();
      }

      // Notify Accounts (e.g., if this wizard has been called from the end of the New Account wizard)
      widget.ActionNotificationSend("AccountRefresh", { accountId: mRecordId }, null, true);
    },

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

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

&lt;/script&gt;</TemplateText>
    <TemplateTextBookmarks />
    <TimeoutSeconds>60</TimeoutSeconds>
    <UniqueId>iiiV3P4lEkyaivmN+DwuRQ</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 />
    <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>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="AccountId" 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.Accounts</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="Action" 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>Accept,Decline,Unwanted</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
        </Parameters>
      </ISParameterDefs>
    </Parameters>
  </finScript>