Event registration example

The following example shows the entries made in the BusinessObjectFile.config to register events for the extension assembly that manages contact history information for the customer object. The events registered here correspond to the six sample event handler methods described in Extension Assembly.

The extension assembly in this example has the name "ExtensionExample". The event handler static methods are located in the class named "ContactHistory", in the namespace "ExtensionExample". Each event specifies the appropriate event handler type for that event.

<DictionaryEntry>
    <Key xsi:type="xsd:string">Microsoft.Dynamics.GP.Customer</Key>
    <Value xsi:type="BusinessObjectConfiguration">
        <Event>
            <EventName>Retrieved</EventName>
            <EventHandlerType>
                <Type>Microsoft.Dynamics.Common.BusinessObjectEventHandler</Type>
                <Assembly>Microsoft.Dynamics.Common</Assembly>
            </EventHandlerType>
            <EventHandler>
                <SoftwareVendor>MicrosoftDocumentation</SoftwareVendor>
                <Type>ExtensionExample.ContactHistory</Type>
                <StaticMethod>GetContactHistory</StaticMethod>
                <Assembly>ExtensionExample</Assembly>
                <Execute>true</Execute>
            </EventHandler>
        </Event>
        <Event>
            <EventName>ValidatingForUpdate</EventName>
            <EventHandlerType>
                <Type>Microsoft.Dynamics.Common.BusinessObjectValidateForUpdateEventHandler</Type>
                <Assembly>Microsoft.Dynamics.Common</Assembly>
            </EventHandlerType>
            <EventHandler>
                <SoftwareVendor>MicrosoftDocumentation</SoftwareVendor>
                <Type>ExtensionExample.ContactHistory</Type>
                <StaticMethod>ValidateUpdateContactHistory</StaticMethod>
                <Assembly>ExtensionExample</Assembly>
                <Execute>true</Execute>
            </EventHandler>
        </Event>
        <Event>
            <EventName>Updating</EventName>
            <EventHandlerType>
                <Type>Microsoft.Dynamics.Common.BusinessObjectUpdateEventHandler</Type>
                <Assembly>Microsoft.Dynamics.Common</Assembly>
            </EventHandlerType>
            <EventHandler>
                <SoftwareVendor>MicrosoftDocumentation</SoftwareVendor>
                <Type>ExtensionExample.ContactHistory</Type>
                <StaticMethod>UpdateContactHistory</StaticMethod>
                <Assembly>ExtensionExample</Assembly>
                <Execute>true</Execute>
            </EventHandler>
        </Event>
        <Event>
            <EventName>ValidatingForCreate</EventName>
            <EventHandlerType>
                <Type>Microsoft.Dynamics.Common.BusinessObjectValidateEventHandler</Type>
                <Assembly>Microsoft.Dynamics.Common</Assembly>
            </EventHandlerType>
            <EventHandler>
                <SoftwareVendor>MicrosoftDocumentation</SoftwareVendor>
                <Type>ExtensionExample.ContactHistory</Type>
                <StaticMethod>ValidateCreateContactHistory</StaticMethod>
                <Assembly>ExtensionExample</Assembly>
                <Execute>true</Execute>
            </EventHandler>
        </Event>
        <Event>
            <EventName>Creating</EventName>
            <EventHandlerType>
                <Type>Microsoft.Dynamics.Common.BusinessObjectEventHandler</Type>
                <Assembly>Microsoft.Dynamics.Common</Assembly>
            </EventHandlerType>
            <EventHandler>
                <SoftwareVendor>MicrosoftDocumentation</SoftwareVendor>
                <Type>ExtensionExample.ContactHistory</Type>
                <StaticMethod>CreateContactHistory</StaticMethod>
                <Assembly>ExtensionExample</Assembly>
                <Execute>true</Execute>
            </EventHandler>
        </Event>
        <Event>
            <EventName>Deleting</EventName>
            <EventHandlerType>
                <Type>Microsoft.Dynamics.Common.BusinessObjectEventHandler</Type>
                <Assembly>Microsoft.Dynamics.Common</Assembly>
            </EventHandlerType>
            <EventHandler>
                <SoftwareVendor>MicrosoftDocumentation</SoftwareVendor>
                <Type>ExtensionExample.ContactHistory</Type>
                <StaticMethod>DeleteContactHistory</StaticMethod>
                <Assembly>ExtensionExample</Assembly>
                <Execute>true</Execute>
            </EventHandler>
        </Event>
    </Value>
</DictionaryEntry>