ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.TaskAssistant Namespace / TaskAssistantFactory 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.

In This Topic
    OpenTaskItemAsync(Guid,Guid) Method
    In This Topic
    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.GetTaskItemInfoAsync method to obtain information about the tasks within a task item.
    Syntax
    public Task<Guid> OpenTaskItemAsync( 
       Guid taskItemGuid,
       Guid taskGuid
    )
    Public Overloads 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 CloseTaskItemAsync or ExportTaskItemAsync.
    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 ArcGIS.Desktop.TaskAssistant.Exceptions.OpenTaskException will be thrown. Task items can only be opened if the Tasks pane is not in Designer mode.

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also