Article Details
Id:22238
Product:finPOWER Connect
Type:NEW
Version:6.00.02
Opened:03/04/2024
Closed:25/09/2025
Released:11/12/2025
Job: J033225

ISUserData Table is now available for Scripting UserData without being linked to a record

Scripting UserData is now available without the need to attach UserData to a record, such as an Account, Client, Security Statement, User or Workflow.

This is achieved by using the helper functions in finBL.UserDataFunctions, of which there are several to:

  • Add
  • Update (via the add function)
  • Delete

All of the functions available in finBL.UserDataFunctions allow modification of data in the ISUserData table.

There is also Timestamp handling which allows accurate and timely updates for critical information stored in the ISUserData table.

Add / Update Data

The standard function to add / update data is:

  Public Function Add(sourceType As Integer,
                      sourcePk As Integer,
                      key As String,
                      ByRef userDataPk As Integer,
             Optional valueString As String = "",
             Optional valueDate As Date = Nothing,
             Optional valueInteger As Integer = 0,
             Optional valueDecimal As Decimal = 0,
             Optional valueMemo As String = "",
             Optional timestamp As Integer = 0,
             Optional updateIfRecordExists As Boolean = True) As Boolean

sourceType, sourcePk and key must be a unique combination, and if already found in ISUserData, the 'add' becomes an 'update', provided that the updateIfRecordExists parameter is True.

userDataPk holds the Pk of the record in ISUserData. This applies to both new and updated records.

The timestamp for a record can be retrieved by using finBL.UserDataFunctions.GetTimestamp (or via a custom query). This can be supplied in the timestamp parameter, or if you'd like to skip timestamp validation, -1 can be supplied. This is only applicable for records being updated, not records being added.

There are also helper functions which on-call this main function, but streamline its use. Initially, the following helper functions are also available:

  • finBL.UserDataFunctions.AddDate
  • finBL.UserDataFunctions.AddDecimal
  • finBL.UserDataFunctions.AddInteger
  • finBL.UserDataFunctions.AddMemo
  • finBL.UserDataFunctions.AddString

Delete Data

Records can be deleted from ISUserData by using this function:

  Public Function Delete(sourceType As Integer,
                         sourcePk As Integer,
                         key As String,
                Optional errorIfNotExists As Boolean = False) As Boolean

Optionally, the errorIfNotExists parameter controls whether the process should fail if the record didn't exist.

Data Retrieval

There are no dedicated functions to retrieve data from ISUserData, as that can be achieved with a standard ISSelectQueryBuilder object.

The following columns are available in the ISUserData table:

  • Pk (int; identity)
  • SourceType (smallint)
  • SourcePk (int)
  • Key (nvarcar; 50 characters max-length)
  • ValueType (not used - will be hard-coded to '0')
  • Value (nvarchar; 255 characters max-length)
  • ValueDate (datetime)
  • ValueInteger (int)
  • ValueDecimal (money)
  • ValueMemo (nvarchar; no max-length)
  • Timestamp (int)

Note: The combination of SourceType, SourcePk and Key is enforced to be unique.