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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156