Codeunit "Agent Message"

ID 4307
Namespace: System.Agents

Properties

Name Value
InherentEntitlements X
InherentPermissions X

Methods

GetText

Get the message text for the given agent task message.

procedure GetText(var AgentTaskMessage: Record "Agent Task Message"): Text

Parameters

Name Type Description
AgentTaskMessage Table System.Agents."Agent Task Message"

Agent task message.

Returns

Type Description
Text

The body of the agent task message.

UpdateText

Updates the message text.

procedure UpdateText(var AgentTaskMessage: Record "Agent Task Message"; NewMessageText: Text)

Parameters

Name Type Description
AgentTaskMessage Table System.Agents."Agent Task Message"

The message record to update.

NewMessageText Text

New message text to set.

IsEditable

Check if it is possible to edit the message.

procedure IsEditable(var AgentTaskMessage: Record "Agent Task Message"): Boolean

Parameters

Name Type Description
AgentTaskMessage Table System.Agents."Agent Task Message"

Agent task message to verify.

Returns

Type Description
Boolean

If it is possible to change the message.

SetStatusToSent

Sets the message status to sent.

procedure SetStatusToSent(var AgentTaskMessage: Record "Agent Task Message")

Parameters

Name Type Description
AgentTaskMessage Table System.Agents."Agent Task Message"

Agent task message to update status.

SetIgnoreAttachment

Set whether to ignore attachments for the message. When set to true, attachments will be marked as ignored and will not be processed by the agent. The default value is false.

procedure SetIgnoreAttachment(IgnoreAttachment: Boolean)

Parameters

Name Type Description
IgnoreAttachment Boolean

If true, attachments will be marked as ignored when added to a message.

DownloadAttachments

Downloads the attachments for a specific message.

procedure DownloadAttachments(var AgentTaskMessage: Record "Agent Task Message")

Parameters

Name Type Description
AgentTaskMessage Table System.Agents."Agent Task Message"

Message to download attachments for.

ShowAttachment

Shows the attachments for a specific message. If file is not supported to be shown, it will be downloaded.

procedure ShowAttachment(TaskID: BigInteger; FileID: BigInteger)

Parameters

Name Type Description
TaskID BigInteger

Task ID to download attachments for.

FileID BigInteger

File ID to download.

ShowAttachment

Shows the attachments for a specific message. If file is not supported to be shown, it will be downloaded.

procedure ShowAttachment(var AgentTaskFile: Record "Agent Task File")

Parameters

Name Type Description
AgentTaskFile Table System.Agents."Agent Task File"

Agent file to display.

GetAttachments

Loads the attachments for a specific message to the temporary buffer.

procedure GetAttachments(TaskID: BigInteger; MessageID: Guid; var TempAgentTaskFile: Record "Agent Task File" temporary)

Parameters

Name Type Description
TaskID BigInteger

Task ID to download attachments for.

MessageID Guid

Message ID to download attachments for.

TempAgentTaskFile Table System.Agents."Agent Task File"

Temporary buffer to load the attachments.

GetFileSizeDisplayText

Get the display text for the file size.

procedure GetFileSizeDisplayText(SizeInBytes: Decimal): Text

Parameters

Name Type Description
SizeInBytes Decimal

The size in bytes.

Returns

Type Description
Text

The display text for the file size.

See also