Comments Panel

OK, possibly another easy one. I’m trying to set up a Comments Panel in my project. I created a table in my database with all of the required columns listed in the manual. However, I’m not exactly clear on how I need to set up my Queries to tie the information coming from the Comments Panel component to my table. Can someone give me an example of how to set up the Queries for this? Thanks.


The default values for the queries on this component should work for you if you have set up the db tables per the manual. All the data is entered into those queries behind the scenes. For example, the Insert Query 1 field expects something like this: INSERT INTO Notes (Note, WhoId, TStamp, Attachment, Filename, Sticky) VALUES (?, (SELECT Id FROM Users WHERE Username='%s'), CURRENT_TIMESTAMP, ?, ?, ?) and it is filling in all 5 of the variables for you. Just drop a new Comments Panel on the screen to see the default strings for the queries; you should only ever need to change the column and/or table names in them.


Part of my problem in understanding how this works is that the manual calls for the columns ID, Username, Timestamp, NoteText, AttachmentFilename, and Stick. When you drop the panel into your project, Query 1 is looking for Note, WhoId, TStamp, Attachment, Filename, and Sticky.

When I use the default query, and set up my Notes table to match the columns listed in the query, I get the following error when I try to add a note:

OK, I got it ironed out so that I can add a note to my Notes table. However, the Comments Panel does not display the notes I have added, only the default original notes. Do I need to add or adjust and queries to display my table data? Thanks.


As far as I can make out, you will have to put in a query of your notes database that returns a dataset with the column headings expected by the control e.g.SELECT ID , WhoId as Username , TStamp as TimeStamp , Note as NoteText , Filename as AttachmentFilename , Sticky as Stick FROM NotesI think it would be much easier if the default database queries matched the column names expected by the dataset.

I still haven’t got attachments working correctly or figured out the use of the 2nd Insert Query…

Thanks, Al! That did it. I had it half right, I just didn’t have the query redirecting the column name info to what the comments panel was looking for, so it puked every time it started up. It’s displaying now. In my application, I didn’t need the 2nd insert query right now, so I just deleted it. I’ve been playing around with it, and the attachments seem to work, but when I click the attachment in the note to download it, it wants to save as the original file name plus a .null extension. That, plus it minimizes my running project. Otherwise, it’s working great!

Ahem, yes, this component probably needs a bit of work on our part, and some better instructions. Glad you got it mostly working.

As for the minimizing of the client, I fear you are using full-screen mode, is this true?


Yes, I am running full-screen. I don’t forsee this being a huge issue in the field, though. I kind of doubt anyone will try to attach a file, and in any case, I’ll include a note in the operator training that this could occur. Thanks.