Service.onServiceEventName event

The name and occurrence of this event are defined by the service. For example, if a service defines an event with the name SomethingHappened, WPD Automation will expose an event handler called service*.onSomethingHappened*. You can assign a JScript function to the event handler to be notified whenever this event is raised. The event parameters will also be passed into the script-defined function, and should match the parameters defined by the service for that event.

Syntax

Service.onServiceEventName(
  EventParameters
)

Parameters

EventParameters

Defined by the service.

Return value

This event does not return a value.

Remarks

Any events that are defined by a service can be accessed through the Service object that represents that service.

Examples

The following code shows the handler-function syntax for the onServiceEventName event. In this example, the name of the service-defined event is SomethingHappened.

function HandlerFunction(EventParameters)
{

   // Code to handle the event.

}

// Set the event handler.
Service.onSomethingHappened = HandlerFunction;

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]

See also

Service Object