-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathAgentMessage.Codeunit.al
89 lines (81 loc) · 3.37 KB
/
AgentMessage.Codeunit.al
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace System.Agents;
codeunit 4307 "Agent Message"
{
InherentEntitlements = X;
InherentPermissions = X;
/// <summary>
/// Get the message text for the given agent task message.
/// </summary>
/// <param name="AgentTaskMessage">Agent task message.</param>
/// <returns>The body of the agent task message.</returns>
[Scope('OnPrem')]
procedure GetText(var AgentTaskMessage: Record "Agent Task Message"): Text
var
AgentMessageImpl: Codeunit "Agent Message Impl.";
begin
exit(AgentMessageImpl.GetMessageText(AgentTaskMessage));
end;
/// <summary>
/// Updates the message text.
/// </summary>
/// <param name="AgentTaskMessage">The message record to update.</param>
/// <param name="NewMessageText">New message text to set.</param>
[Scope('OnPrem')]
procedure UpdateText(var AgentTaskMessage: Record "Agent Task Message"; NewMessageText: Text)
var
AgentMessageImpl: Codeunit "Agent Message Impl.";
begin
AgentMessageImpl.UpdateText(AgentTaskMessage, NewMessageText);
end;
/// <summary>
/// Check if it is possible to edit the message.
/// </summary>
/// <param name="AgentTaskMessage">Agent task message to verify.</param>
/// <returns>If it is possible to change the message.</returns>
[Scope('OnPrem')]
procedure IsEditable(var AgentTaskMessage: Record "Agent Task Message"): Boolean
var
AgentMessageImpl: Codeunit "Agent Message Impl.";
begin
exit(AgentMessageImpl.IsMessageEditable(AgentTaskMessage));
end;
/// <summary>
/// Sets the message status to sent.
/// </summary>
/// <param name="AgentTaskMessage">Agent task message to update status.</param>
[Scope('OnPrem')]
procedure SetStatusToSent(var AgentTaskMessage: Record "Agent Task Message")
var
AgentMessageImpl: Codeunit "Agent Message Impl.";
begin
AgentMessageImpl.SetStatusToSent(AgentTaskMessage);
end;
/// <summary>
/// Add an attachment to the task message.
/// </summary>
/// <param name="FileName">The name of the file to be attached.</param>
/// <param name="FileMIMEType">The MIME type of the file to be attached.</param>
/// <param name="Attachment">The attachment stream.</param>
[Scope('OnPrem')]
procedure AddAttachment(var AgentTaskMessage: Record "Agent Task Message"; FileName: Text[250]; FileMIMEType: Text[100]; Attachment: InStream)
var
AgentMessageImpl: Codeunit "Agent Message Impl.";
begin
AgentMessageImpl.AddAttachment(AgentTaskMessage, FileName, FileMIMEType, Attachment);
end;
/// <summary>
/// Downloads the attachments for a specific message.
/// </summary>
/// <param name="AgentTaskMessage">Message to download attachments for.</param>
[Scope('OnPrem')]
procedure DownloadAttachments(var AgentTaskMessage: Record "Agent Task Message")
var
AgentMessageImpl: Codeunit "Agent Message Impl.";
begin
AgentMessageImpl.DownloadAttachments(AgentTaskMessage);
end;
}