Top Method Summary
Options Name Purpose
AssignAttachmentData (handle, longchar) Assigns the Base64 encoded content of a file to the AttachmentData field of the current record
Consultingwerk.SmartFramework.System.AttachmentListResponse BuildAttachmentList (AttachmentDatasetModel) Returns the attachments in the model, sorted by name
INTEGER DeleteAttachmentRows (character) Deletes the attachments matching a where phrase
Consultingwerk.IntegerHolder DeleteAttachments (DeleteAttachmentsParameter) Deletes attachments
Consultingwerk.LogicalHolder DeleteComment (CommentParameter) Deletes a comment
LOGICAL DeleteRow (character, logical) Deletes an attachment or a comment
FillRecordRows (AttachmentDatasetModel, character, character, character) Fills the model with the attachments or the comments of a record
Consultingwerk.SmartFramework.System.AttachmentListResponse GetAttachments (AttachmentRecordParameter) Returns the attachments of a record
Consultingwerk.SmartFramework.System.CommentInfo GetComment (CommentParameter) Returns a comment with its text
Consultingwerk.SmartFramework.System.CommentListResponse GetComments (AttachmentRecordParameter) Returns the comments of a record
LoadAttachmentRoles () Loads the attachment roles into the ttRole temp-table
LoadCommentRoles () Loads the comment roles into the ttRole temp-table
HANDLE OpenSortedQuery (AttachmentDatasetModel, handle) Opens a query on the rows of the model, sorted by name
Consultingwerk.CharacterHolder ProposeCommentTitle (ProposeCommentTitleParameter) Proposes the title of a new comment
CHARACTER ResolveAttachmentRole (character) Returns the attachment role for new attachments
CHARACTER ResolveTableGuid (character, character) Returns the TableGUID of the SmartTable record of an entity table
CHARACTER RoleName (character) Returns the name of a role in the ttRole temp-table
Consultingwerk.SmartFramework.System.CommentInfo SaveComment (SaveCommentParameter) Creates a comment (no CommentGuid) or updates a comment
LOGICAL TitleExists (character, character, character, character, character) Returns if another row of the record uses the title
Consultingwerk.SmartFramework.System.AttachmentListResponse UploadAttachments (UploadAttachmentsParameter) Creates attachments from uploaded files


Method Detail
Top

AssignAttachmentData (handle, longchar)

Purpose: Assigns the Base64 encoded content of a file to the AttachmentData
field of the current record
Notes:

Parameters:
phBuffer HANDLE
The handle of the eSmartAttachment buffer
plcContent LONGCHAR
The Base64 encoded content of the file
Top

Consultingwerk.SmartFramework.System.AttachmentListResponse BuildAttachmentList (AttachmentDatasetModel)

Purpose: Returns the attachments in the model, sorted by name
Notes:

Parameters:
poModel Consultingwerk.SmartFramework.System.AttachmentDatasetModel
The AttachmentDatasetModel with the attachments
Returns Consultingwerk.SmartFramework.System.AttachmentListResponse
The AttachmentListResponse
Top

INTEGER DeleteAttachmentRows (character)

Purpose: Deletes the attachments matching a where phrase
Notes: SCL-6351. Comments are skipped

Parameters:
pcWhere CHARACTER
The where phrase for the eSmartAttachment table (without the WHERE keyword)
Returns INTEGER
The number of deleted attachments
Top

Consultingwerk.IntegerHolder DeleteAttachments (DeleteAttachmentsParameter)

Purpose: Deletes attachments
Notes: Rows that do not exist (any more) and comments are skipped. The
parent record is not refreshed. SCL-6351: one fetch and one save
per 50 attachments

Parameters:
poParameter Consultingwerk.SmartFramework.System.DeleteAttachmentsParameter
The DeleteAttachmentsParameter with the AttachmentGUID values
Returns Consultingwerk.IntegerHolder
The IntegerHolder with the number of deleted attachments
Top

Consultingwerk.LogicalHolder DeleteComment (CommentParameter)

Purpose: Deletes a comment
Notes: Throws a CommentNotFoundException (HTTP status 404) when the
comment does not exist. The parent record is not refreshed

Parameters:
poParameter Consultingwerk.SmartFramework.System.CommentParameter
The CommentParameter with the AttachmentGUID of the comment
Returns Consultingwerk.LogicalHolder
The LogicalHolder with the value true
Top

LOGICAL DeleteRow (character, logical)

Purpose: Deletes an attachment or a comment
Notes:

Parameters:
pcAttachmentGuid CHARACTER
The AttachmentGUID of the row
plComment LOGICAL
Logical value indicating if the row is expected to be a comment (true) or an attachment (false)
Returns LOGICAL
Logical value indicating if the row was found and deleted
Top

FillRecordRows (AttachmentDatasetModel, character, character, character)

Purpose: Fills the model with the attachments or the comments of a record
Notes:

Parameters:
poModel Consultingwerk.SmartFramework.System.AttachmentDatasetModel
The AttachmentDatasetModel to fill
pcTableGuid CHARACTER
The TableGUID of the parent record
pcRecordKeyValue CHARACTER
The key value of the parent record
pcRoleField CHARACTER
The name of the role field that tells attachments (AttachmentRoleGUID) and comments (CommentRoleGUID) apart
Top

Consultingwerk.SmartFramework.System.AttachmentListResponse GetAttachments (AttachmentRecordParameter)

Purpose: Returns the attachments of a record
Notes: Comments are not part of the list. The content of an attachment
is downloaded through the SmartAttachmentWebHandler

Parameters:
poParameter Consultingwerk.SmartFramework.System.AttachmentRecordParameter
The AttachmentRecordParameter with the parent record
Returns Consultingwerk.SmartFramework.System.AttachmentListResponse
The AttachmentListResponse with the attachments, sorted by name
Top

Consultingwerk.SmartFramework.System.CommentInfo GetComment (CommentParameter)

Purpose: Returns a comment with its text
Notes: The text is returned as an HTML fragment. Throws a
CommentNotFoundException (HTTP status 404) when the comment
does not exist

Parameters:
poParameter Consultingwerk.SmartFramework.System.CommentParameter
The CommentParameter with the AttachmentGUID of the comment
Returns Consultingwerk.SmartFramework.System.CommentInfo
The CommentInfo with title, comment role and text
Top

Consultingwerk.SmartFramework.System.CommentListResponse GetComments (AttachmentRecordParameter)

Purpose: Returns the comments of a record
Notes: The list does not contain the text of the comments, see GetComment

Parameters:
poParameter Consultingwerk.SmartFramework.System.AttachmentRecordParameter
The AttachmentRecordParameter with the parent record
Returns Consultingwerk.SmartFramework.System.CommentListResponse
The CommentListResponse with the comments, sorted by title
Top

LoadAttachmentRoles ()

Purpose: Loads the attachment roles into the ttRole temp-table
Notes:

Top

LoadCommentRoles ()

Purpose: Loads the comment roles into the ttRole temp-table
Notes:

Top

HANDLE OpenSortedQuery (AttachmentDatasetModel, handle)

Purpose: Opens a query on the rows of the model, sorted by name
Notes: The caller deletes the query and the buffer

Parameters:
poModel Consultingwerk.SmartFramework.System.AttachmentDatasetModel
The AttachmentDatasetModel with the rows
phBuffer HANDLE
OUTPUT The handle of the buffer of the query
Returns HANDLE
The handle of the opened query
Top

Consultingwerk.CharacterHolder ProposeCommentTitle (ProposeCommentTitleParameter)

Purpose: Proposes the title of a new comment
Notes: The proposal consists of the name of the comment role and the
current date and time. Without a (valid) comment role, the
first comment role is used. Throws a
NoCommentRoleDefinedException when no comment role is defined

Parameters:
poParameter Consultingwerk.SmartFramework.System.ProposeCommentTitleParameter
The ProposeCommentTitleParameter with the comment role
Returns Consultingwerk.CharacterHolder
The CharacterHolder with the proposed title
Top

CHARACTER ResolveAttachmentRole (character)

Purpose: Returns the attachment role for new attachments
Notes: Throws a NoAttachmentRoleDefinedException when no attachment role
is defined. Without a (valid) attachment role in the request, the
only attachment role is used; with several attachment roles an
AttachmentRoleRequiredException is thrown

Parameters:
pcAttachmentRoleGuid CHARACTER
The GUID of the attachment role from the request
Returns CHARACTER
The GUID of the attachment role to use
Top

CHARACTER ResolveTableGuid (character, character)

Purpose: Returns the TableGUID of the SmartTable record of an entity table
Notes: Resolves the database table the same way as the
AttachmentDataAccess does when an attachment is created

Parameters:
pcEntityName CHARACTER
The name of the Business Entity
pcEntityTable CHARACTER
The name of the entity table
Returns CHARACTER
The TableGUID
Top

CHARACTER RoleName (character)

Purpose: Returns the name of a role in the ttRole temp-table
Notes: Returns an empty string when the role is not known

Parameters:
pcRoleGuid CHARACTER
The GUID of the role
Returns CHARACTER
The name of the role
Top

Consultingwerk.SmartFramework.System.CommentInfo SaveComment (SaveCommentParameter)

Purpose: Creates a comment (no CommentGuid) or updates a comment
Notes: Title and comment role are mandatory and the title is unique
per record, each rule raises its own exception (ICommentService).
Throws a NoCommentRoleDefinedException when no comment role is
defined. The HTML text is converted to RTF before it is saved.
The parent record is not refreshed

Parameters:
poParameter Consultingwerk.SmartFramework.System.SaveCommentParameter
The SaveCommentParameter with the comment
Returns Consultingwerk.SmartFramework.System.CommentInfo
The CommentInfo with the saved comment, the text as it reads after the conversion
Top

LOGICAL TitleExists (character, character, character, character, character)

Purpose: Returns if another row of the record uses the title
Notes: The title (AttachmentName) is part of the primary unique index of
the SmartAttachment table (TableGUID, RecordKeyValue,
AttachmentFolder, AttachmentName)

Parameters:
pcTableGuid CHARACTER
The TableGUID of the parent record
pcRecordKeyValue CHARACTER
The key value of the parent record
pcFolder CHARACTER
The attachment folder of the comment
pcTitle CHARACTER
The title to verify
pcExcludeGuid CHARACTER
The AttachmentGUID of the comment that is saved (excluded from the check)
Returns LOGICAL
Logical value indicating if another row with the title exists
Top

Consultingwerk.SmartFramework.System.AttachmentListResponse UploadAttachments (UploadAttachmentsParameter)

Purpose: Creates attachments from uploaded files
Notes: The files are passed with their name and their Base64 encoded
content and share one attachment role. Throws a
NoAttachmentRoleDefinedException when no attachment role is
defined and an AttachmentRoleRequiredException when several
are defined and the request names none. The parent record is
not refreshed

Parameters:
poParameter Consultingwerk.SmartFramework.System.UploadAttachmentsParameter
The UploadAttachmentsParameter with the parent record, the attachment role and the files
Returns Consultingwerk.SmartFramework.System.AttachmentListResponse
The AttachmentListResponse with all attachments of the record, sorted by name


©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       24.11.2026 10:08:40