I am trying to show ALL notes on a lead. What I mean is that this lead will have notes directly associated with the lead. But in addition it will also have several activities associated with the lead. Each activity would have their note as well as the lead itself having notes. I want to show all these notes in the notes list for the lead. I was able to track down all notes regardless of where they come from to the AnnotationBase table. And I was able to identify the association between the annotations, the activities and the lead. Look at the SQL code below.
DECLARE @Account VARCHAR(100)
SET @Account = '80328AAE-21FC-DC11-BA41-000C29A53E6E'
SELECT AnnotationId
FROM AnnotationBase
WHERE ObjectID in ( SELECT ActivityID As ObjectID
FROM ActivityPointerBase a
WHERE RegardingObjectID = @Account
UNION
SELECT @Account as Object
)
I just cannot see how to modify CRM to show these notes. I looked in the Annotation and FilteredAnnotation views, but didn't see where I could apply this logic. If anyone has any suggestions or can tell me how to accomplish this, please let me know.