Article Details
Id:13391
Product:finPOWER Connect
Type:NEW
Version:2.03.04
Opened:16/10/2015
Closed:16/10/2015
Released:03/02/2016
Job: J016387

Approve Disbursements; new scripting option for individual Disbursement Approval

Disbursements now include better scripting options when approving individual Disbursements.

Currently a script can be setup to run during the Approve Disbursements wizard. However, this script did not run when approving individual Disbursements from the Account form, Disbursements page.

A script of type "Object Events", object "AccountDisbursementApprove" should be created to handle Disbursement Approval events. After a script has been created, it must be configured under Global Settings, Accounts, Scripts page, "AccountDisbursementApprove" 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 cancel 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.

Note, you should consider updating any existing Approve Disbursements wizard script as follows:

1. The "AccountDisbursementsApprove.RefreshPre" and "AccountDisbursementsApprove.RefreshPost" events can remain as they are. However, if you are using these events to prevent a User completing an approval, e.g. if the Account is overdue, you should consider duplicating to the new script object and events.

2. The "AccountDisbursementsApprove.CommitPre" and "AccountDisbursementsApprove.CommitPost" events should be migrated to the new script object and events.