Article Details
Id: | 19138 |
Product: | finPOWER Connect |
Type: | NEW |
Version: | 3.04.04 |
Opened: | 04/04/2022 |
Closed: | 04/04/2022 |
Released: | 09/06/2022 |
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);