Article Details
Id:10524
Product:finPOWER Connect
Type:FIX
Version:1.06.04
Opened:19/09/2012
Closed:20/09/2012
Released:24/10/2012
Job: J010410

Script Account Object Events; "CalculateAfterInitialiseA" and "CalculateAfterInitialiseB" can cause issues

If using an "Object Event" script for an "Account" the "CalculateAfterInitialiseA" and "CalculateAfterInitialiseB" events can cause issues after the Account is saved, and is still a "Quote".

If the script touches Account sub-objects, eg Clients, then when reviewing the Account it appears to not have any of those sub-objects, eg Clients. This is because, although the Account exists and has been loaded, at the time the script event runs, the Account's IsNew property is incorrectly still set to True - which means sub-objects do not bother loading information.

For example, the following code demonstrates this issue:

AccountCalc = DirectCast(source, finAccountCalc)
Account = DirectCast(AccountCalc.Parent, finAccount)

For Each AccountClient In Account.Clients
Next