Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# ITask.CreateSubTask Method

Creates a sub-task for the current task.

ITask CreateSubTask(
string name,
string description,
DateTime startTime,
DateTime endTime
);

#### Parameters

name
  Name of the sub-task; cannot be `null`.
description
  Description of the sub-task; cannot be `null`.
startTime
  Start time of the sub-task; cannot be `null`.
endTime
  End time of the sub-task; cannot be `null`.

#### Return Value

The new sub-task.

#### Remarks

The current task must have been stored before creating a sub-task.

If the current task is a dependent source task of other tasks, it cannot have any sub-tasks, and `CollaborationException` will be thrown.

Note that the value of the start date and end date stored in the database may vary by a few milliseconds from the supplied date. The date in this object will reflect the stored date after a call to `Store`.

#### Exceptions

Exception Type | Condition
--- | ---
InvalidOperationException | if the object has not yet been stored or has already been removed.
CollaborationException | The current task already has task dependency, or if the method call resulted in an error.
SoapException | if there is a communication problem during the execution of the remote method call.

#### See Also

ITask Interface | Plumtree.Remote.PRC.Collaboration.Tasklist Namespace