We are trying to add some custom commerce events (BaseCommerceEvent) and
log
it to IIS for use in the DW and Re****ting Services.
We have followed some instructions (below) and we get an error:
Could not get type for "...". Please provide a valid and fully qualified
name for a CommerceEvent type in config settings.
STEP 1 - Create your Event Class
a.. Write a class that inherits from BaseCommerceEvent
b.. Add as many properties you want. As long as they can be serialized
you
will be fine. These will be the properties that get logged to the IIS
event
log and eventually re****ted on.
[Microsoft.CommerceServer.Runtime.CommerceEventAttribute("SomeIDForYourEvent")]
public class YourCustomEvent : BaseCommerceEvent
{
string m_strAString;
public YourCustomEvent()
{
}
override public bool Validate()
{
return true;
}
[Microsoft.CommerceServer.Runtime.CommerceEventMemberAttribute("SomeIDForPropertyYouWant")]
public string SomeStringValue
{
get
{
return m_strAString;
}
set
{
m_strAString = value;
}
}
}
STEP 2 - Register the event in web.config
a.. Add the event to the web.config
<commerceEvent>
<add className="YourAssemblypath.YourCustomEvent"
id="SomeIDForYourEvent" loggingEnabled="true" />
</commerceEvent>
STEP 3 - Log the event
a.. Write the event to the log from codebehind.
YourCustomEvent myEvent = new YourCustomEvent();
myEvent.SomeStringValue = "Hi JF";
CommerceContext.LogCommerceEvent(myEvent);