Hey Guys,
Thanks for the great answers and I will dig into this for sure! I don't think I was clear on my original question however. The field that I need to add to the index doesn't currently have any data in it. I need to fill in that data when a particular page type is either saved or updated. In my case, it's an Attorney page type.
I have tried wiring up the custom class module in both the WebApp.sln and a separate code project, making sure that I have the Assembly Discoverable in the AssemblyInfo.cs per the documentation. However, I don't think the event is firing for some reason and I don't know why. Below is the code that I have to this point:
[assembly: RegisterModule(typeof(SaveAttorneyOverride))]
namespace MHCustomModules.SaveAttorneyAdmissionsCourts
{
public class SaveAttorneyOverride : Module
{
public SaveAttorneyOverride() : base("JimsTest")
{
}
// Contains initialization code that is executed when the application starts
protected override void OnInit()
{
base.OnInit();
// Assigns custom handlers to events
DocumentEvents.Insert.After += Document_Insert_After;
DocumentEvents.Update.After += Document_Update_After;
}
private void Document_Insert_After(object sender, DocumentEventArgs e)
{
// Add code to add in the text value here
}
private void Document_Update_After(object sender, DocumentEventArgs e)
{
EventLogProvider.LogInformation("Page Update Test", "Attorney Updated");
}
}
}
As you can see, I've even tried just adding some logging to the document update method and I don't see my log updates in the Kentico log. Any help would be greatly appreciated. Thanks!