Show all Notes for Lead, Opportunity and Account RRS feed

  • Question

  • 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
         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.

    Wednesday, April 2, 2008 2:52 PM


  • I posted about how to get all files associated with an entity here, which should give you a decent idea about how to get the data you want


    Wednesday, April 2, 2008 7:18 PM