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

Sets the units for a Web Enrolment. 

By default, when a Web Enrolment is processed, the new enrolment gets all the non-optional units that are in the occurrence that the Web Enrolment is for. Use this method to choose which units in the occurrence the new enrolment will get. The units must be on the occurrence that the Web Enrolment is for. 

A Web Enrolment ID (webEnrolId) is passed as a parameter. This should be the ID returned by the function used to create the web enrolment: AddClientWebEnrolment or AddEmployerWebEnrolment

The parameter unitCodes is a List of strings, indicating the codes of the units to include in the web enrolment. The easiest way to get a list of these is to use the GetUnitsForOccurrence function to get a list of all units in the occurrence the Web Enrolment is for. 

A subsequent call to this function for the same Web Enrolment ID will override all the units assigned on any previous call for that Web Enrolment ID. 

Note that when the web enrolment is processed, if you have used this AddUnitsToWebEnrolment function to exclude some units from the occurrence in the new web enrolment, then any occurrence prices linked to those excluded units will also not be included in the new enrolment, whether or not you have used the AddPriceTypesToWebEnrolment function to specify pricing items for those excluded units. 

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

Requires a valid registration key entry for the Short Courses feature. 

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 = "Records the specified units against the existing web enrolment ID")]
public TAuthenticate AddUnitsToWebEnrolment(string token, int webEnrolId, List<string> unitCodes);
Parameters 
Description 
string token 
String containing a token. 
int webEnrolId 
Integer ID of Web Enrolment. 
List<string> unitCodes 
List of strings, which are the codes of the units to include in the web enrolment. 

TAuthenticate : an Authenticate Object containing the result of the update.

Copyright (c) VETtrak 2022. All rights reserved.