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

Enrol a Client in an LMS Occurrence. 

A Client Code (sClie_Code) and an LMS Occurrence ID (iOccurrenceId) are passed as parameters. An enrolment is created which links the Client with the Occurrence. Both of the above parameters must be valid, otherwise no enrolment will be created. In particular, the Occurrence must be an LMS occurrence (ENRO_LMS_PUBLISH = 1), and the client must not already be enrolled in the occurrence. 

If you need to enrol a new client, call AddClient or AddClientAfterCheck first to create the new client, then pass the client's code into this function. 

The new enrolment record is created as an LMS enrolment (ENRO_LMS_PUBLISH = 1), with LMS status (ENRO_LMS_STATUS) set to 1 (that is, it is marked as being in the LMS). 

The new enrolment will get any units (except those marked as optional), tasks (except those linked only to optional units, and including "loose" tasks that are not linked to any of the occurrence's units), staff, published prices and invoice schedules that are on the occurrence, and the enrolled client will be added to all classes in the occurrence. 

If the "auto link enrolments" preference is ticked, it will check if the enrolling client has any existing active enrolments with a date range that overlaps the new occurrence enrolment and contain any of the units in the occurrence that the new enrolment is going into. If so, these existing enrolments will be linked to the new enrolment, and the units will not be enrolled again in the new enrolment. 

This function may also automatically transfer the new enrolment to an LMS for online learning, if the relevant add-on is installed and the occurrence is configured to do so. 

If successful, the function returns a TAuthClieEnro object containing a TClieEnro object, which contains, among other things, the ID of the new enrolment. 

A token is passed for authentication. If the authentication fails, or other errors occur, no enrolment is created. 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 = "Enrols the client with the specified code into the LMS-enabled occurrence with the specified ID")]
public TAuthClieEnro AddLMSClientEnrolmentToOccurrence(string sToken, string sClie_Code, int iOccurrenceId, int? referralId, string description, int? studyReasonId);
Parameters 
Description 
string sToken 
String containing a token. 
string sClie_Code 
String containing the Code of the Client. Maximum length 10 characters. 
int iOccurrenceId 
Integer ID of the Occurrence to enrol in. 
int? referralId 
Integer ID of the referral source for the enrolment. Pass 0 or null for none. Call GetReferralSources for a list of referral sources to use. 
string description 
String description to record against the enrolment. 
int? studyReasonId 
Integer ID of the study reason for the enrolment. Pass 0 or null to default to the study reason on the occurrence. Call GetStudyReasonsForOccurrence for a list of valid study reasons that can be used. 

TAuthClieEnro : an Authenticated Client Enrolment object.

Copyright (c) VETtrak 2022. All rights reserved.