NEW3.03.03 · Released 1 October 2020
NEWfinPOWER Connect
Released in
3.03.03
1 October 2020
  1. Opened13 Jul
  2. Closed13 Jul
  3. Released1 Oct
Article 17161 Job J024610

Business Layer; ISCodeDescriptionList objects can now be populated from a DataTable

The following function has been added to the ISCodeDescriptionList Class: FromDataTable(dataTable, Code, Description)

This allows a Code Description List to be populated from two columns of a DataTable.

An example of how this may be used is demonstrated below.

Public Function Main(parameters As ISKeyValueList) As Boolean

  Dim CodeDescriptionList As ISCodeDescriptionList

  ' Assume Success
  Main = True  
  
  ' Initialise
  CodeDescriptionList = finBL.Runtime.CreateCodeDescriptionList()
  
  ' Populate List with US States
  If CodeDescriptionList.FromDataTable(finBL.Addressing.GetStatesDataTable("US"), "Code", "Description") Then
    finBL.DebugPrint(CodeDescriptionList.ToJsonString())
  Else 
    Main = False
  End If
  
End Function