Skip to content

Commit 161fbea

Browse files
authored
[Agent] Create Agent Task Context part with timeline links (#6095)
<!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> Create re-usable task context part with timeline links. #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#615121](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/615121)
1 parent 40d1fcb commit 161fbea

5 files changed

Lines changed: 116 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// ------------------------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// Licensed under the MIT License. See License.txt in the project root for license information.
4+
// ------------------------------------------------------------------------------------------------
5+
6+
namespace System.Agents;
7+
8+
using System.Agents.TaskPane;
9+
10+
page 4343 "Agent Task Context Part"
11+
{
12+
ApplicationArea = All;
13+
Caption = 'Context';
14+
Editable = false;
15+
InherentEntitlements = X;
16+
InherentPermissions = X;
17+
PageType = CardPart;
18+
SourceTable = "Agent Task";
19+
20+
layout
21+
{
22+
area(Content)
23+
{
24+
field(AgentName; Rec."Agent Display Name")
25+
{
26+
Caption = 'Agent name';
27+
ToolTip = 'Specifies the name of the agent that performed the tasks.';
28+
29+
trigger OnDrillDown()
30+
var
31+
TaskPane: Codeunit "Task Pane";
32+
begin
33+
TaskPane.ShowAgent(Rec."Agent User Security ID");
34+
end;
35+
}
36+
field(TaskID; Rec.ID)
37+
{
38+
Caption = 'Task ID';
39+
ToolTip = 'Specifies the ID of the task that was executed.';
40+
Editable = false;
41+
ExtendedDatatype = Task;
42+
43+
trigger OnDrillDown()
44+
var
45+
TaskPane: Codeunit "Task Pane";
46+
begin
47+
TaskPane.ShowTask(Rec);
48+
end;
49+
}
50+
field(TaskTitle; Rec.Title)
51+
{
52+
Caption = 'Task title';
53+
ToolTip = 'Specifies the title of the task that was executed.';
54+
Visible = Rec.Title <> '';
55+
}
56+
field(CompanyName; Rec."Company Name")
57+
{
58+
Caption = 'Company name';
59+
ToolTip = 'Specifies the name of the company in which the task was executed.';
60+
}
61+
}
62+
}
63+
}

src/System Application/App/Agent/Interaction/Internal/AgentTaskList.Page.al

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace System.Agents;
77

8+
using System.Agents.TaskPane;
89
using System.Environment.Consumption;
910

1011
#pragma warning disable AS0032
@@ -35,6 +36,15 @@ page 4300 "Agent Task List"
3536
field(TaskID; Rec.ID)
3637
{
3738
Caption = 'Task ID';
39+
Editable = false;
40+
ExtendedDatatype = Task;
41+
42+
trigger OnDrillDown()
43+
var
44+
TaskPane: Codeunit "Task Pane";
45+
begin
46+
TaskPane.ShowTask(Rec);
47+
end;
3848
}
3949
field(Title; Rec.Title)
4050
{
@@ -83,6 +93,13 @@ page 4300 "Agent Task List"
8393
{
8494
Caption = 'Agent';
8595
ToolTip = 'Specifies the agent that is associated with the task.';
96+
97+
trigger OnDrillDown()
98+
var
99+
TaskPane: Codeunit "Task Pane";
100+
begin
101+
TaskPane.ShowAgent(Rec."Agent User Security ID");
102+
end;
86103
}
87104
field(CreatedByID; Rec."Created By")
88105
{

src/System Application/App/Agent/Interaction/Internal/AgentTaskLogEntryList.Page.al

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ page 4303 "Agent Task Log Entry List"
7676
}
7777
}
7878
}
79+
80+
area(FactBoxes)
81+
{
82+
part(TaskContext; "Agent Task Context Part")
83+
{
84+
ApplicationArea = All;
85+
Caption = 'Task context';
86+
AboutTitle = 'Context information about the task and agent';
87+
AboutText = 'Shows context information such as the agent name, task ID, and company name.';
88+
SubPageLink = ID = field("Task ID");
89+
}
90+
}
7991
}
8092

8193
actions

src/System Application/App/Agent/Interaction/Internal/AgentTaskMessageCard.Page.al

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ page 4308 "Agent Task Message Card"
9292
}
9393
}
9494

95+
area(FactBoxes)
96+
{
97+
part(TaskContext; "Agent Task Context Part")
98+
{
99+
ApplicationArea = All;
100+
Caption = 'Task context';
101+
AboutTitle = 'Context information about the task and agent';
102+
AboutText = 'Shows context information such as the agent name, task ID, and company name.';
103+
SubPageLink = ID = field("Task ID");
104+
}
105+
}
95106
}
96107

97108
actions

src/System Application/App/Agent/Interaction/Internal/AgentTaskMessageList.Page.al

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ page 4301 "Agent Task Message List"
1818
Editable = false;
1919
InherentEntitlements = X;
2020
InherentPermissions = X;
21+
SourceTableView = sorting("Task Id", "Memory Entry Id") order(descending);
2122

2223
layout
2324
{
@@ -70,6 +71,18 @@ page 4301 "Agent Task Message List"
7071
}
7172
}
7273
}
74+
75+
area(FactBoxes)
76+
{
77+
part(TaskContext; "Agent Task Context Part")
78+
{
79+
ApplicationArea = All;
80+
Caption = 'Task context';
81+
AboutTitle = 'Context information about the task and agent';
82+
AboutText = 'Shows context information such as the agent name, task ID, and company name.';
83+
SubPageLink = ID = field("Task ID");
84+
}
85+
}
7386
}
7487

7588
trigger OnAfterGetRecord()

0 commit comments

Comments
 (0)