Human Capital Management Apex API Developer Reference

vanahcm.LearningCourseService

global with sharing class LearningCourseService

Represents a Learning Course service structure

Methods

create

global static List<ID> create(List<vanahcm.CommonService.LearningCourse> learningCourses)

Insert Learning Courses

Input Parameters

Name Type Description
learningCourses List<vanahcm.CommonService.LearningCourse> Learning Course records that need to be inserted

Return Value

List of ID

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

vanahcm.CommonService.LearningCourse learningCourse = new vanahcm.CommonService.LearningCourse();
learningCourse.LearningCatalog = 'a2Q150000007QIM';

List<vanahcm.CommonService.LearningCourse> learningCourses = new List<vanahcm.CommonService.LearningCourse>();
learningCourses.add(learningCourse);

List<ID> resultIds = vanahcm.LearningCourseService.create(learningCourses);

modify

global static List<ID> modify(List<vanahcm.CommonService.LearningCourse> learningCourses)

Insert or update Learning Courses

Input Parameters

Name Type Description
learningCourses List<vanahcm.CommonService.LearningCourse> Learning Course records that need to be inserted or updated

Return Value

List of ID

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

vanahcm.CommonService.LearningCourse learningCourse = new vanahcm.CommonService.LearningCourse();
learningCourse.Id = 'a2S15000000VCPg';
learningCourse.LearningCatalog = 'a2Q150000007QIM';

List<vanahcm.CommonService.LearningCourse> learningCourses = new List<vanahcm.CommonService.LearningCourse>();
learningCourses.add(learningCourse);

List<ID> resultIds = vanahcm.LearningCourseService.modify(learningCourses);

getById

global static List<vanahcm.CommonService.LearningCourse> getById(Set<ID> ids, Set<Schema.SObjectField> customFields)

Get learning course records based on learning course ID

Input Parameters

Name Type Description
ids Set<ID> ID of learning course records that need to be returned
customFields Set<Schema.SObjectField> Set of custom fields that need to be queried for Learning Course

Return Value

List of LearningCourse

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<ID> learningCourseIds = new Set<ID>();
learningCourseIds.add('a2S15000000VCPg');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Learning_Plan__c.CreatedById};

List<vanahcm.CommonService.LearningCourse> learningCourses = vanahcm.LearningCourseService.getById(learningCourseIds, customFields);

getByName

global static List<vanahcm.CommonService.LearningCourse> getByName(Set<String> names, Set<Schema.SObjectField> customFields)

Get Learning Course records based on learning course Name

Input Parameters

Name Type Description
names Set<String> Name of learning course records that need to be returned
customFields Set<Schema.SObjectField> Set of custom fields that need to be queried for Learning Course

Return Value

List of LearningCourse

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<String> names = new Set<String>();
names.add('Learning');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Learning_Plan__c.CreatedById};

List<vanahcm.CommonService.LearningCourse> learningCourses = vanahcm.LearningCourseService.getByName(names, customFields);

getByWorker

global static List<vanahcm.CommonService.LearningCourse> getByWorker(Set<ID> workerIds, Set<Schema.SObjectField> customFields)

Get learning course records based on learning course worker ID

Input Parameters

Name Type Description
workerIds Set<ID> Worker ID of learning course records that need to be returned
customFields Set<Schema.SObjectField> Set of custom fields that need to be queried for Learning Course

Return Value

List of LearningCourse

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<ID> workerIds = new Set<ID>();
workerIds.add('a4G15000000PiPk');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Learning_Plan__c.CreatedById};

List<vanahcm.CommonService.LearningCourse> learningCourses = vanahcm.LearningCourseService.getByWorker(workerIds, customFields);
© Copyright 2009–2019 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.