Id: | 21515 |
Product: | finPOWER Connect |
Type: | NEW |
Version: | 4.01.01 |
Opened: | 27/05/2024 |
Closed: | 29/05/2024 |
Released: | 24/06/2024 |
Job: | J033590 |
Bank Export; new script event when new Export Batch loaded
A Bank Export consists of two phases:
- Creating the Export header and linking Bank Transactions to it.
- Creating the file itself.
The second step already has script events to customise the file created. It is also used when re-exporting a file.
The first step did not have any script events. A script event has now been added. This event "LoadPost" will run after the Export Batch has been loaded and allows you to set various properties:
- CanInclude
- This property is ReadOnly, but the "CanIncludeForceFalse" method will force it to False.
- This means the User will still see the Transaction, but cannot include it in the export.
- Include
- Indicates whether or not the Transaction will be included in the export.
- By default this is always True if CanInclude is True.
In addition, you can delete Transactions entirely from the list by using the "RemoveAt" function.
To create a script, add a new script of Type "Object Events", Object "BankExportCreate" and paste the template code into the Script Code page. Then change the "LoadPost" event script as you require.
A sample code snippet is shown below:
Select Case eventId
Case "LoadPost"
' The Export Batch has been loaded and can now be modified.
' Limit to the Export Service "EXPORTA"
Select Case BankExportCreate.ExportServiceId
Case "EXPORTA"
' Remove the first line
BankExportCreate.BankTransactions.RemoveAt(0)
' Force CanInclude to False for the first line
BankExportCreate.BankTransactions(0).CanIncludeForceFalse
End Select
End Select
Next, link the script in Global Settings. Under the Account group, Script page, set "BankExportCreate" to the script you have added.
Note, you should be careful using these options. Never exporting Transactions will lead to the list of Transactions growing and growing. Therefore, you should have an alternative method to export Transactions that you may be excluding.