Codeunit "Agent Task Builder"

ID 4315
Namespace: System.Agents

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

Create a new task for the agent.

procedure Create(): Record "Agent Task"

Returns

Type Description
Table System.Agents."Agent Task"

Agent task that was created.

Remarks

The builder keeps the state, do not reuse the same instance of the builder to create multiple tasks.

Create

Create a new task for the agent.

procedure Create(SetTaskStatusToReady: Boolean): Record "Agent Task"

Parameters

Name Type Description
SetTaskStatusToReady Boolean

Specifies if the task status should be set to ready after creation.

Returns

Type Description
Table System.Agents."Agent Task"

Agent task that was created.

Remarks

The builder keeps the state, do not reuse the same instance of the builder to create multiple tasks.

GetAgentTaskMessageCreated

Get the agent task message that was created.

procedure GetAgentTaskMessageCreated(): Record "Agent Task Message"

Returns

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

The agent task message that was created.

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.

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.

See also