Article Details
Id:13464
Product:finPOWER Connect
Type:NEW
Version:2.03.04
Opened:30/11/2015
Closed:30/11/2015
Released:03/02/2016
Job: J016628

Reverse Disbursements; new Business Layer object and scripting events added

Disbursements now include a new object and script events for use when reversing Disbursements.

It is now possible to create an AccountDisbursementRevese object via finBL.CreateAccountDisbursementReverse() and use this to reverse Disbursements.

Note, the current finBL.AccountFunctions.DisbursementReverse function still operates exactly the same, and the same script events fire. Note, the "dateReversed" parameter is now ignored.

A script of type "Object Events", object "AccountDisbursementReverse" should be created to handle Disbursement Reverse events. After a script has been created, it must be configured under Global Settings, Accounts, Scripts page, "AccountDisbursementReverse" event script.

The script can handle four events:

ExecuteCommitPre
Runs at the start of ExecuteCommit and can be used to validate and tweak values. Return False, with an error message, to reverse the Commit.

ExecuteCommitPreInTransaction
Runs during ExecuteCommit, after a Database Transaction has begun but before any work has started. It can be used much like the ExecuteCommitPre event, but because it is in a Database Transaction must not be used to interact with the user.

ExecuteCommitPostInTransaction
Runs during ExecuteCommit, after work has been completed but before the Database Transaction is committed. Use to implement additional functionality that must be part of the overall Commit.

ExecuteCommitPost
Runs at the end of ExecuteCommit. Since the Database Transaction is complete use with caution. Any failure here will not affect the overall Commit. added

Note, via scripting functions it is now possible to automatically reverse the related Bank Transaction for the Disbursement, where the Payee Type is "Account". Within one of the events above, or via a script that has created an AccountDisbursementReverse object, set the ReverseBankTransaction to True, and define the ReverseDate and ReverseReason.