Codeunit "Agent Task Builder"
This codeunit is used to create an agent task.
Properties
| Name | Value |
|---|---|
| InherentEntitlements | X |
| InherentPermissions | X |
Methods
Initialize
Initialize the agent task builder with the mandatory parameters.
procedure Initialize(NewAgentUserSecurityId: Guid; NewTaskTitle: Text[150]): Codeunit "Agent Task Builder"
Parameters
| Name | Type | Description |
|---|---|---|
| NewAgentUserSecurityId | Guid | |
| NewTaskTitle | Text[150] |
Returns
| Type | Description |
|---|---|
| Codeunit System.Agents."Agent Task Builder" |
This instance of the Agent Task Builder. |
Create
procedure Create()
Create
procedure Create(SetTaskStatusToReady: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| SetTaskStatusToReady | Boolean |
Create
procedure Create(SetTaskStatusToReady: Boolean; RequiresMessage: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| SetTaskStatusToReady | Boolean | |
| RequiresMessage | Boolean |
GetAgentTaskMessageCreated
procedure GetAgentTaskMessageCreated()
SetExternalId
Set the external ID of the task.
procedure SetExternalId(ExternalId: Text[2048]): Codeunit "Agent Task Builder"
Parameters
| Name | Type | Description |
|---|---|---|
| ExternalId | Text[2048] |
The external ID of the task. This field is used to connect to external systems, like Message ID for emails. |
Returns
| Type | Description |
|---|---|
| Codeunit System.Agents."Agent Task Builder" |
This instance of the Agent Task Builder. |
SetModelId
Set the model ID that will be used to process the task. If the model ID is not set, the model from the agent will be used, if any. If the agent does not have a model, the default model will be used.
procedure SetModelId(ModelId: Code[30]): Codeunit "Agent Task Builder"
Parameters
| Name | Type | Description |
|---|---|---|
| ModelId | Code[30] |
The model ID of the task. This field is used to connect to external systems, like Message ID for emails. |
Returns
| Type | Description |
|---|---|
| Codeunit System.Agents."Agent Task Builder" |
This instance of the Agent Task Builder. |
AddTaskMessage
Add a task message to the task. Only a single message can be added to the task.
procedure AddTaskMessage(From: Text[250]; MessageText: Text): Codeunit "Agent Task Builder"
Parameters
| Name | Type | Description |
|---|---|---|
| From | Text[250] |
The sender of the message. |
| MessageText | Text |
The message text. |
Returns
| Type | Description |
|---|---|
| Codeunit System.Agents."Agent Task Builder" |
This instance of the Agent Task Builder. |
AddTaskMessage
Add a task message to the task. Only a single message can be added to the task.
procedure AddTaskMessage(var AgentTaskMessageBuilder: Codeunit "Agent Task Message Builder"): Codeunit "Agent Task Builder"
Parameters
| Name | Type | Description |
|---|---|---|
| AgentTaskMessageBuilder | Codeunit System.Agents."Agent Task Message Builder" |
The agent task message builder. |
Returns
| Type | Description |
|---|---|
| Codeunit System.Agents."Agent Task Builder" |
This instance of the Agent Task Builder. |
GetTaskMessageBuilder
Get the agent task message builder.
procedure GetTaskMessageBuilder(): Codeunit "Agent Task Message Builder"
Returns
| Type | Description |
|---|---|
| Codeunit System.Agents."Agent Task Message Builder" |
The agent task message builder. |
TaskExists
Check if a task exists for the given agent user and conversation
procedure TaskExists(AgentUserSecurityId: Guid; ConversationId: Text): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| AgentUserSecurityId | Guid | |
| ConversationId | Text |
The conversation ID to check. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if task exists, false if not. |