How events are processed

When the Dynamics GP service is started, it reads the entries in the BusinessObjectsFile.config to determine which additional events it should process. As the Dynamics GP service processes requests, it makes the appropriate calls to the extension assemblies for which events are registered. These extension assemblies must have static methods with the specified names and proper event signatures so they can be called by the Dynamics GP service.

When called, the event handling code in the extension assembly processes the request. Information about the request, such as the business object being processed, is available in the arguments passed to the event handling code.

Depending on the event type, the response from the event handling code can influence further processing. For example, if the event handler for the event ValidateForUpdate encounters a validation error, the code in the event handler will add that error to the ValidationResult object passed back to the Dynamics GP service. After all of the ValidateForUpdate events have been run, the Dynamics GP service will examine whether any validation errors have been noted. If any have, the Dynamics GP service will log the validation exceptions and stop any further processing.