ASP.NET VETtrak API web services
ContentsIndexHome
PreviousUpNext
VT_API.UpdateEnrolledTask Method

Updates the status and dates of an enrolled task.

C#
[WebMethod(Description = "Records a result for a single enrolled task")]
public TAuthenticate UpdateEnrolledTask(string token, int enrolmentId, string taskCode, string tastCode, DateTime startDate, DateTime? dueDate, DateTime statusDate, DateTime? completeDate, int? percentage, string description);
Parameters 
Description 
string token 
String containing a token 
int enrolmentId 
Integer ID of the enrolment containing the task to complete 
string taskCode 
String code of the task to complete. Maximum length 20 characters. 
string tastCode 
Code of the status that is to be set against the enrolled tasks. 
DateTime startDate 
Date that the task was started. 
DateTime? dueDate 
Optional date that the task is due to complete. 
DateTime statusDate 
Date the task status was updated. 
DateTime? completeDate 
Date the task was completed. Required, and only allowed, when the task status is of the "completed" type. 
int? percentage 
Optional percentage value for the completion of the task. 
string description 
Optional string description to record against the task result. 

TAuthenticate indicating whether the update was complete

This function updates the status of a single enrolled task. 

The enrolmentId and taskCode parameters identify the enrolled task to update. The task must already be in that enrolment. 

The tastCode parameter is the code of the task status to set. Use GetTaskStatuses to get a list of these. 

The completeDate parameter is the date at which the task was complete. It can and must only be set when setting a completed status. Normally you would use today's date. It must not be in the future if VETtrak is configured to not allow completed results to be future dated. 

The description parameter are notes to record against this completed task. It overwrites any existing description. 

The enrolled task will be marked as completed by the user that owns the specified token. An error will occur when attempting to call this function with a token that belongs to an employer. 

Note that, depending on the configuration in VETtrak, it is possible that recording a task result may automatically start or complete one or more enrolled units that the task is linked to. For this function to work, the automatic unit result options must have been configured in VETtrak using Global Preferences. 

Information about what tasks are available to be updated can be discovered by using functions such as GetEnrolledTasksForClient, GetEnrolledTasksForOccurrence and GetEnrolledTasksForEnrolledUnit

The returned TAuthenticate object indicates whether or not the update was successful. 

A token is passed for authentication. If the authentication fails, or other errors occur, no result is recorded. The result of the authentication is represented by a TAuthenticate object. 

Requires a valid registration key entry for the Tasks feature. 

This function has security level "Protected", and can only be accessed by users that have explicitly been granted permission to the API.

Copyright (c) VETtrak 2022. All rights reserved.