Welcome to Forums Sign in | Join | Help | Forums
in Search





Make the world a better place.

Custom part to view newly added Class Notes

Last post 05-02-2008 7:55 AM by Garrett Keating. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-01-2008 11:21 AM

    Custom part to view newly added Class Notes

    Hello all,

    I want to create a custom part to pull newly added Class Notes into a small scrolling section on a page.
    What is the best way to access this info in the custom part?
    Should I use the RE web service, or is there a way to pull this info directly from BBNC that I'm missing?

    Thanks,
    George

     

  • 05-02-2008 7:55 AM In reply to

    • Garrett Keating
    • Top 100 Contributor
    • User Since: 2006
    • Posts 54
    • Organization: U.S. Naval Academy Alumni Association
    • Products:  Blackbaud NetCommunity, The Financial Edge, The Information Edge, The Raiser's Edge

    Re: Custom part to view newly added Class Notes


    I'd use the API
    here is some code that might get you started!
     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim RE7 As REAPI = initAPI()
            Dim mosc As IBBSessionContext
            Dim oClass As New Blackbaud.PIA.RE7.BBREAPI.CRecord 'Class Record
            Dim notes As Blackbaud.PIA.RE7.BBREAPI.IBBNotepadsAPI 'Notes for the class
            Dim note As Blackbaud.PIA.RE7.BBREAPI.IBBNotepad
            If Not RE7 Is Nothing Then
                Dim dTable As New DataTable("Notes")
                Dim dRow As DataRow
                dTable.Columns.Add("Note")
                dTable.Columns.Add("Date")
                mosc = DirectCast(RE7.SessionContext, IBBSessionContext)
                With oClass
                    .Init(mosc)
                    .Load(284353, True) 'id of a class, readonlly = true
                    notes = .Notepads 'pop the notes for the class
                    For Each note In notes
                        If CType(note.Fields(ENotepadFields.NOTEPAD_fld_NotepadDate), Date).AddDays(30) >= Date.Today Then 'this will just get all notes in the last 30 days and then add it to a datatable
                            dRow = dTable.NewRow()
                            dRow.Item("Note") = note.Fields(ENotepadFields.NOTEPAD_fld_ActualNotes)
                            dRow.Item("Date") = note.Fields(ENotepadFields.NOTEPAD_fld_NotepadDate)
                            dTable.Rows.Add(dRow)
                        End If
                    Next
                    DataGridView1.DataSource = dTable
                End With
            End If
        End Sub
     

    Garrett Keating
    Senior Web Developer
    U.S. Naval Academy Alumni Association and Foundation
    www.usna.com
    customizebbnc.blogspot.com
    www.photosbygarrett.com
Page 1 of 1 (2 items)