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

Update the result of a Unit of an Enrolment, including any linked units. 

Use this function to set or change the result of an Enrolment Unit. Updating the result includes setting the result type, start and finish dates, percentage (assessment score) and the staff member who made the update.  

An Enrolment ID (enrolmentId) is passed as a parameter. enrolmentId must specify a valid Enrolment, otherwise, the Result is not updated.  

A Unit Code (unitCode) is passed as a parameter. unitCode must specify a valid Unit Code which is a linked to the Enrolment (enrolmentId) or is within another enrolment that it is linked to, otherwise, the Result is not updated.  

A Result Name (resultName) is passed as a parameter. resultName must specify a valid Result Name, otherwise, the Result is not updated. See the function, GetResultTypes, for a listing of valid Result Names.  

The Unit's Start and End Date (startDate and finishDate) are passed as parameters. These are DateTime objects where the time component is significant. They must be populated with sensible dates (Start > Finish is not considered sensible), otherwise, the Result is not updated.  

An assessment score (percentage) is passed as a parameter. This should be an integer in the range 0 - 100 to reflect an assessment score. If assessments are not scored, set this parameter to -1.  

The comment (comment) is passed as a parameter. This is a string of the comment to record against the enrolled unit. It replaces any existing comment. It can be empty to retain any existing comment. 

This list will also include any "linked units". When updating results for a client occurrence enrolment, if the occurrence enrolment is linked to any of the client's other enrolments, and the occurrence contains a unit that the other linked enrolment also contains, the enrolled unit from the other linked enrolment can also be resulted. This allows scenarios such as a client's "master enrolment" (perhaps in a contract) that contains all the units and results the client is doing as part of a qualification, and allow the client to be enrolled in "delivery occurrences" for each block of training that is done that contains just the units being delivered in that block. 

Enrolments can be linked or unlinked within VETtrak, and automatically linked when creating the client occurrence enrolment. 

It is also possible for this function to update the result in several enrolled units, if the same unit is in multiple linked enrolments for the client. 

When a result is updated, any previous results are assigned to the Enrolment Unit History table. 

You can get a valid list of units for an enrolment for which you can set a result, including linked units, using the GetUnitsForEnrolmentIncludingLinked function. 

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

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

C#
[WebMethod(Description = "Updates the result for the specified enrolment ID and unit code to the result details specified, including linked units")]
public TAuthenticate UpdateResultIncludingLinked(string token, int enrolmentId, string unitCode, string resultName, DateTime startDate, DateTime finishDate, int percentage, string comment);
Parameters 
Description 
string token 
String containing a token. 
int enrolmentId 
Integer ID of Enrolment. 
string unitCode 
String Unit Code. Maximum length 12 characters. 
string resultName 
String Result Name. Maximum length 100 characters. 
DateTime startDate 
DateTime Start Date of Unit in this Enrolment. 
DateTime finishDate 
DateTime Finish Date of Unit in this Enrolment. 
int percentage 
Integer Percentage assesment score. Pass -1 if the assessment is not scored. 
string comment 
String of the comment to record against the enrolled unit. 

TAuthenticate : a TAuthenticate object containing the status of the update. This contains properties Status and StatusMessage which will indicate if the update is successful.

Copyright (c) VETtrak 2022. All rights reserved.