I have created an Event Receiver (Farm Solution) in SharePoint 2016 that triggers when an item is added in Task list. I have exclusively specified the ListTemplateId="107" in Elements.xml. This event receiver works fine when I add new item directly through browser in any of the Task list but when an item is added by Workflow in Task list then in
properties.ListItem.URL property, first
/Lists/Tasks/ is returned which is proper but later
/Lists/WorkflowHistory/.... is returned which is very strange. Where as ListTemplateID for Workflow History list is 140. I doubt the problem created here is due to Workflow.
Any help is appreciated.