PublicAPI.Docflow.Document.AddComment ELMA API Documentation
Add a comment
 
 
Syntax

public void AddComment(
	Document document,
	Comment comment
)

Parameters

document
Type: Document
Document, a comment will be added to. Object. Access path: PublicAPI.Docflow.Document
comment
Type: Comment
Comment. Object. Access path: PublicAPI.Portal.Objects.Common.Comment
Examples

//create a comment and fill its properties 
var comment = PublicAPI.Portal.Objects.Common.Comment.Create();
comment.CreationAuthor = PublicAPI.Portal.Security.User.GetCurrentUser();
comment.CreationDate = DateTime.Now;
comment.Text = "Comment";

//load the document by ID 
var document = PublicAPI.Docflow.Document.LoadOrNull(23);

//Add the comment
PublicAPI.Docflow.Document.AddComment(document, comment);

//WARNING!! You can add only ONE comment in one transaction 
//Example:
comment.Text = "Comment, which will be added";
PublicAPI.Docflow.Document.AddComment(doc, comment, commentAuthor); //this comment will be added
comment.Text = "Comment, which will not be added";
PublicAPI.Docflow.Document.AddComment(doc, comment, commentAuthor); //this comment will not be added
See Also