NEW3.04.04 · Released 9 June 2022
NEWfinPOWER Connect
Released in
3.04.04
9 June 2022
  1. Opened4 Apr
  2. Closed4 Apr
  3. Released9 Jun
Article 19138 Job J028558

Business Layer Global Collections; updated to better support C#

Global Collections in the finPOWER Connect Business Layer have been updated to better support C#.

New functions have been added as follows:

  • GetItem(id As String)
  • GetItemByIndex(index As Integer)
  • GetItemByPk(pk As Integer)

This makes it easier for C# scripts to use, as parameterized properties are not supported in C# and don't show in intellisense.

From Visual Basic, you can access collections such as Documents using the record Id, e.g.:

finBL.DebugPrint(finBL.Documents("AL").Description)

When using C#, you must use the array syntax or new function instead:

// Array Syntax
finBL.DebugPrint(finBL.Documents["AL"].Description);

// New Function
finBL.DebugPrint(finBL.Documents.GetItem("AL").Description);

Another way to access global collections such as this is to use the ItemByPk or ItemByIndex properties, e.g.:

finBL.DebugPrint(finBL.Documents.ItemByPk(1).Description)

When accessing via C#, the code generated as Intermediate Language includes "get_ItemByPk" and if a writeable property "set_ItemByPk". It is easier to use the new functions as they are shown in intellisense.

// get_ Syntax
finBL.DebugPrint(finBL.Documents.get_ItemByPk(1).Description);

// New Function
finBL.DebugPrint(finBL.Documents.GetItemByPk(1).Description);