Comments Panel

I am looking for any tips or tutorials on how to configure the “comments panel” components.
I set up a few tables in the database that correspond with “what I thought” where used by this component. I am missing something. Was hoping someone out here has used this and had some notes they could share.

WOW I found the documentation
inductiveautomation.com/supp … syntax.htm

I should read this first… :prayer:

Good, let us know if you run into any problems.

its a long road trying to find the perfect turbo encabulator!

Call me old fashioned, but I like the feel of the retro encabulator better.
Of course, neither of them beat a good interocitor… sigh.

Comments panel in the manual linked below:

inductiveautomation.com/supp … spanel.htm

Just to add on to this, here is an example intended to be indexed on a tag path.

MySQL

CREATE TABLE IF NOT EXISTS `notes` (
  `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `UserName` varchar(45) NOT NULL,
  `TimeStamp` datetime NOT NULL,
  `NoteText` text NOT NULL,
  `TagName` varchar(45) NOT NULL,
  `IsSticky` tinyint(3) unsigned NOT NULL,
  `Attachment` longblob DEFAULT NULL,
  `AttachmentName` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ;

MS SQL (assumes the database is called sqltags)

USE [sqltags]
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[notes]') AND type in (N'U'))
DROP TABLE [dbo].[notes]
GO

USE [sqltags]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[notes](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[TimeStamp] [datetime] NOT NULL,
	[NoteText] [ntext] NOT NULL,
	[TagName] [nvarchar](255) NOT NULL,
	[IsSticky] [int] NOT NULL,
	[Attachment] [varbinary](max) NULL,
	[AttachmentName] [nvarchar](50) NULL,
 CONSTRAINT [PK_notes] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

Alarm Notes.vwin (10.3 KB)

Nice example. This is very helpful. :thumb_left:

I ended up building my own. We needed to have dropdowns with preconfigured comments, that way we can track calibrations and search for other stuff without having to worry about typos. I also set it up so that the user can use the current timestamp or use a calender component to enter in a manual timestamp if they dont get around to entering the comment in for a few days.

1 Like

One problem I found with this example… if you add a note with an attachment it works fine. If you add a note without an attachment it won’t accept a null in the Attachment column and throws up an error.

Maybe this is just a sql2005 thing? Not sure how to get around this as the Attachment column is set to accept nulls.

Probably just need to change the table schema to fit your needs. This was tested using MySQL. The MS SQL table hasn’t actually been used/tested yet.

I having this problem as well (SQL2008 db) and still working around without a solution.

Another question, how can we getting DataSet of Comments panel while adding a new Note?

To get the attachments to work with MS SQL Server you can set the INSERT QUERY 1 to the following:INSERT INTO Notes (Note, Username, TStamp, Attachment, Filename, Sticky) VALUES (?, '%s', CURRENT_TIMESTAMP, CAST(? AS VARBINARY(MAX)), ?, ?)Note the CAST(? AS VARBINARY(MAX)).

Thank you Travis, the solution fixed my problem. :slight_smile:

Nice. My customer just asked if they could have drop downs for canned comments, and to be able to edit previous comments. I don’t suppose you would like to post what you have? If you still have this.