![]() Human Capital Management API Developer Reference
|
vanahcm.LearningTypeServiceglobal with sharing class LearningTypeService Represents a learning type service structure Methods
getByNameglobal static List<vanahcm.CommonService.LearningType> getByName(Set<String> names, Map<Schema.SObjectType, Set<Schema.SObjectField>> customFields) Get Learning types with related learning catalog records based on learning type name Input Parameters
Return ValueList of LearningType 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>(); //Add Name of vanahcm__LearningType__c to names names.add('Learning Type1'); Map<Schema.SObjectType, Set<Schema.SObjectField>> customFields = new Map<Schema.SObjectType, Set<Schema.SObjectField>>{ vanahcm__LearningType__c.SObjectType => new Set<Schema.SObjectField>{vanahcm__LearningType__c.vanahcm__LastModifiedById}, vanahcm__Learning_Catalog__c.SObjectType => new Set<Schema.SObjectField>{vanahcm__Learning_Catalog__c.CreatedById}}; List<vanahcm.CommonService.LearningType> learningTypes = vanahcm.LearningTypeService.getByName(names, customFields); getByIdglobal static List<vanahcm.CommonService.LearningType> getById(Set<ID> ids, Map<Schema.SObjectType, Set<Schema.SObjectField>> customFields) Get learning types with related learning catalog records based on learning type ID Input Parameters
Return ValueList of LearningType 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> learningTypeIds = new Set<ID>(); learningTypeIds.add('a0nj000000KcOqN'); Map<Schema.SObjectType, Set<Schema.SObjectField>> customFields = new Map<Schema.SObjectType, Set<Schema.SObjectField>>{ vanahcm__LearningType__c.SObjectType => new Set<Schema.SObjectField>{vanahcm__LearningType__c.LastModifiedById}, vanahcm__Learning_Catalog__c.SObjectType => new Set<Schema.SObjectField>{vanahcm__Learning_Catalog__c.CreatedById}}; List<vanahcm.CommonService.LearningType> learningTypes = vanahcm.LearningTypeService.getById(learningTypeIds, customFields); createglobal static List<vanahcm.LearningTypeService.Result> create(List<vanahcm.CommonService.LearningType> learningTypes) Insert learning type with related learning catalog Input Parameters
Return ValueList of Result 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.LearningType learningType = new vanahcm.CommonService.LearningType(); learningType.Name = 'New Learning Type'; List<vanahcm.CommonService.LearningType> learningTypes = new List<vanahcm.CommonService.LearningType>(); learningTypes.add(learningType); List<vanahcm.LearningTypeService.Result> results = vanahcm.LearningTypeService.create(learningTypes); modifyglobal static List<vanahcm.LearningTypeService.Result> modify(List<vanahcm.CommonService.LearningType> learningTypes) Insert or update learning type with related learning catalog Input Parameters
Return ValueList of Result 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.LearningType learningType = new vanahcm.CommonService.LearningType(); learningType.Id = 'a2P15000000iU1c'; learningType.Name = 'Updated Learning Type'; List<vanahcm.CommonService.LearningType> learningTypes = new List<vanahcm.CommonService.LearningType>(); learningTypes.add(learningType); List<vanahcm.LearningTypeService.Result> results = vanahcm.LearningTypeService.modify(learningTypes); vanahcm.LearningTypeService.Resultglobal with sharing class Result Represents a Result Properties
|