ArcGIS Pro 2.7 API Reference Guide
OpenTaskItemAsync(Guid,Guid) Method

ArcGIS.Desktop.TaskAssistant Namespace > TaskAssistantModule Class > OpenTaskItemAsync Method : OpenTaskItemAsync(Guid,Guid) Method
A unique identifier used to identify the project task item to be opened.
The unique identifier of a task in the task item to be opened. If the task can be found, it is opened and ready to be executed. If the task cannot be found, the task item opens as if no task was specified.
Opens an ArcGIS Pro task item. The item is loaded into the Tasks pane. Use the taskGuid parameter to specify a particular task in the task item to be opened. Use the TaskProjectItem.GetTaskItemInfo method to obtain information about the tasks within a task item.
Syntax
public static Task<Guid> OpenTaskItemAsync( 
   Guid taskItemGuid,
   Guid taskGuid
)
Public Overloads Shared Function OpenTaskItemAsync( _
   ByVal taskItemGuid As Guid, _
   ByVal taskGuid As Guid _
) As Task(Of Guid)

Parameters

taskItemGuid
A unique identifier used to identify the project task item to be opened.
taskGuid
The unique identifier of a task in the task item to be opened. If the task can be found, it is opened and ready to be executed. If the task cannot be found, the task item opens as if no task was specified.

Return Value

A Task returning the unique identifier of the task item. Use this unique identifier as parameters to other API calls such as CloseTaskAsync or ExportTaskAsync.
Exceptions
ExceptionDescription
Error opening the task item. For example the taskItemGuid cannot be found in the project or the Tasks pane is in Designer mode and editing a task item.
This must be called on the UI thread.
Remarks
If the Tasks pane is not already visible, it will be opened. If the Tasks pane is visible, any current task item will be unloaded to allow the new item to be loaded.

If the Tasks pane is in Designer mode; then an OpenTaskException will be thrown. Task items can only be opened if the Tasks pane is not in Designer mode.

Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

TaskAssistantModule Class
TaskAssistantModule Members
Overload List