Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

GP Extension Methods

(0) ShareShare
ReportReport
Posted on by 580

I have created a small GP extension library to monitor the “Created” business object events. I have followed MSDN "HOW TO’s" exactly, but I still cannot get any feedback from the library I had setup (i placed log entries for when hit)… Below is my code and the BusinessObject Config file entry. I have restarted the server after placing the files in the appropriate directory and had also entered some information into GP, but nothing logs??? Any explanations?

namespace RasGPService

{

 public static class GPExtentions

 {

   //private static Connection connection;

   /// <summary>

   /// Event fired on GP Record Created, specified in BusinessObjectFile.config

   /// </summary>

   /// <param name="sender"></param>

   /// <param name="e"></param>

   public static void OnRecordCreated(object sender, BusinessObjectEventArgs e)

   {

     try

     {      

       Customer customer;

       Extension CustomerEmailExtension = new Extension();

       //get current cust connection

       //connection = Connection.GetInstance();

       if (e.BusinessObject.GetType() == typeof(Customer))

       {

         customer = (Customer)e.BusinessObject;

         // Look at the Extension list passed along

         foreach (Extension ext in customer.Extensions)

         {

           Logger.LogExtention(ext);

         }

       }

       else

       {

         Logger.LogExtentionType(e.GetType().ToString());

       }

     }

     catch (Exception ex)

     {

       Logger.LogException(ex.Message);

     }

   }

 }

}

BusinessObjectsFile.config entry:

<DictionaryEntry>

    <Key xsi:type="xsd:string">Microsoft.Dynamics.GP.Customer</Key>

    <Value xsi:type="BusinessObjectConfiguration">

        <Event>

            <EventName>Created</EventName>

            <EventHandlerType>

                <Type>Microsoft.Dynamics.Common.BusinessObjectEventHandler</Type>

                <Assembly>Microsoft.Dynamics.Common</Assembly>

            </EventHandlerType>

            <EventHandler>

                <SoftwareVendor>MicrosoftDocumentation</SoftwareVendor>

                <Type>RasGPService.GPExtentions</Type>

                <StaticMethod>OnRecordCreated</StaticMethod>

                <Assembly>RasGPExtentionMethods</Assembly>

                <Execute>true</Execute>

            </EventHandler>

        </Event>

    </Value>

</DictionaryEntry>

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans