Query file attachments for Notes in DataBase

Can a database script be executed to retrieve the file attachment name for each note record? Alternatively, is there a historical audit log available for querying to determine if an attachment was associated with a note?

Thanking you 

Christopher

Parents
  • Hi Christopher, 

    If in the user interface, you create a note with one attachment two Note records are inserted into the database. 


    One note row will be the note created by the user, and the second one will be created to store the attachment and has attachment_flag='1'

     

    The "Attachment" notes are not listed in the Listview, however, you can access them by copying the ID of the record view. 

    With this in mind, if you want to list all file names of attachment notes you can query for 

    Select id,file_name from notes where attachment_flag='1' .

    If what you want is to find the Parent notes that have "Attachment Notes" related to them you can retrieve the note_parent_id from the notes with attachment_flag=1

    SELECT note_parent_id FROM `notes` where attachment_flag='1';

    Let me know if this leads you in the correct direction. 

    Cheers

Reply
  • Hi Christopher, 

    If in the user interface, you create a note with one attachment two Note records are inserted into the database. 


    One note row will be the note created by the user, and the second one will be created to store the attachment and has attachment_flag='1'

     

    The "Attachment" notes are not listed in the Listview, however, you can access them by copying the ID of the record view. 

    With this in mind, if you want to list all file names of attachment notes you can query for 

    Select id,file_name from notes where attachment_flag='1' .

    If what you want is to find the Parent notes that have "Attachment Notes" related to them you can retrieve the note_parent_id from the notes with attachment_flag=1

    SELECT note_parent_id FROM `notes` where attachment_flag='1';

    Let me know if this leads you in the correct direction. 

    Cheers

Children
No Data