Define event handlers

Use Manager to define and set up event handlers using the Application events dialog box or the Events page for the level on which you want to implement the VBA or DLL.

ReadSoft Invoices's internal VBA engine is recommended only for simple debugging or status messages. We strongly advise against using the VBA engine for production customizations. Use COM plug-ins for production customizations.

  1. Access the Application events dialog or the Events page. It contains a list of all event handlers defined for the context you accessed it for, and is empty the first time you access it.
  2. Click Add to open the Event details dialog box.

    The Event details dialog box is displayed.



  3. On the Event details dialog box, specify the following:
    1. Choose the predefined ReadSoft Invoices event for which you want to create an event handler from the Name box.

      Only events from the current context are visible in the Name box. For example, when you access the Event details dialog box from the Single item profile dialog box, the Name box only contains events that can occur during field processing.

      Likewise, when you access the Application events dialog box, you see all events that can occur in ReadSoft Invoices. You can also see events that are related only to the application itself and not to fields, invoices, etc. Application-specific events have the prefix "App", for example AppCanClose and AppStart.

    2. Specify any VBA function to be called, the name of a DLL and DLL function, or both.
    3. In the Other data box you can specify any data which you want ReadSoft Invoices to make available to the VBA code or DLL. Think of this as parameters to be passed to the event handler, though the semantics differ from the ordinary way of specifying parameters.
  4. When a VBA function is specified, click Code to edit VBA source code in the Visual Basic window.

    Note If you define more than one VBA function for a ReadSoft Invoices event, only the first one on the list is called.