Article Details
Id:17161
Product:finPOWER Connect
Type:NEW
Version:3.03.03
Opened:13/07/2020
Closed:13/07/2020
Released:01/10/2020
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