Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When writing plugins to interact with business logic objects, particularly handling events raised by these objects, it is important to understand the behaviours and sequence of events.

The Save

When the Save() method of a business logic object is invoked, the following occurs in order:

...

Plugins that wish to use the same SQL transaction to update data to ensure consistency should do this in either the SaveStart or SaveEnding events. If using the SaveEnding event then ensure no user interaction is made.

The Read

When the Read(string RecID) of a business logic object is invoked, the following occurs in order:

  1. The ReadStart event is raised

  2. The Clear() method is invoked to clear contents of properties, private members and collections - this will in turn raise the ClearStart and then ClearEnd events.

  3. The data is read

  4. The ReadEnd event is raised

JiwaCollections

All collections or lists in Jiwa are of type JiwaCollection. Each item in the collection inherit from the JiwaCollectionItem class.

Sales order lines, purchase order lines, debtor delivery addresses, Bill input items are all JiwaCollections.

There are several events of JiwaCollections which can be subscribed to, via the public property of the business logic object.

Note that the JiwaCollection events are not raised during the normal read of a business logic object.

Adding

The Adding event is raised when an item is being added to the collection. A CancelEventArgs argument allows this add to be cancelled.

Added

The Added event is raised when an item is added to the JiwaCollection.

Changed

The Changed even is raised when a property if the item changes. The PropertyChangedEventArgs argument has a PropertyName property which contains the name of the property which changed.

Removing

The Removing event is raised when an item is being removed from the JiwaCollection.

Removed

The Removed event is raised when an item is removed from the JiwaCollection.

Common Mistakes

Some of the more common mistakes which can cause significant issues are:

...