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

Update the result of a Unit of an Enrolment. 

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 (iEnro_ID) is passed as a parameter. iEnro_ID must specify a valid Enrolment, otherwise, the Result is not updated.  

A Unit Code (sUnit_Code) is passed as a parameter. sUnit_Code must specify a valid Unit Code which is a linked to the Enrolment (iEnro_ID), otherwise, the Result is not updated.  

A Result Name (sResult_Name) is passed as a parameter. sResult_Name 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 (xsdStart and xsdFinish) 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 (iPercentage) 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. 

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

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")]
public TAuthenticate UpdateResult(string sToken, int iEnro_ID, string sUnit_Code, string sResult_Name, DateTime xsdStart, DateTime xsdFinish, int iPercentage);
Parameters 
Description 
string sToken 
String containing a token. 
int iEnro_ID 
Integer ID of Enrolment. 
string sUnit_Code 
String Unit Code. Maximum length 12 characters. 
string sResult_Name 
String Result Name. Maximum length 12 characters. Maximum length 100 characters. 
DateTime xsdStart 
DateTime Start Date of Unit in this Enrolment. 
DateTime xsdFinish 
DateTime Finish Date of Unit in this Enrolment. 
int iPercentage 
Integer Percentage assesment score. Pass -1 if the assessment is not scored. 

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.