#Description: Example code to add and action an Account Workflow for a Version 2 Workflow Type.
#Author: Intersoft Systems Limited
#Version: 1.00
#Last Updated: 6/1/2016

  Dim Success As Boolean
  Dim Workflow As finWorkflow
  Dim WorkflowExecutor As finWorkflowExecutor

  ' Assume Success
  Success = True

  '====================================
  ' Create Workflow
  Workflow = finBL.CreateWorkflow()
  
  With Workflow
    ' Set Account
    ' If you have the Account's Pk this is more efficient
    .AccountId = "L10000"
    '.AccountPk = 123

    ' Initalise Workflow for the specified Workflow Type
    Success = .Initialise("ChkClients")

    ' Save Workflow
    If Success Then Success = .Save()
  End With

  '====================================
  ' Process Workflow
  If Success Then
    With Workflow  
      ' Process
      Success = finBL.WorkflowFunctions.WorkflowProcess(Workflow, WorkflowExecutor)

      ' Optionally, add Workflow Items from Group "ABC"
      If Success Then
        ' Add Items to the start of the Workflow
        Success = WorkflowExecutor.AddItemGroupFromWorkflowType("ABC", True, 0)

        ' Save Workflow
        If Success Then Success = WorkflowExecutor.WorkflowSave()
      End If
    End With
  End If
