Newer Version Available
LearningItemTypeHandler Class
Represents a handler for a custom learning item type.
Namespace
Usage
Extend the LearningItemTypeHandler abstract class to create a handler for the custom learning item type. See LearningItem from Object Reference for the Salesforce Platform. Create a LearningItemTypeHandler() class for each LearningItemType() class.
Example
This code creates a custom learning item using screen flows for an Enablement program exercise.
1global class LearningItemTypeHandlerScreenFlow extends sfdc_enablement.LearningItemTypeHandler {
2 // Provide the value from the getName() method of the LearningItemType class.
3 global override String getType() {
4 return 'ScreenFlow';
5 }
6
7 // Provide theAPI name of the Salesforce object that stores the custom
8 // exercise data.
9 global override String getEntityId() {
10 return 'FlowDefinitionView';
11 }
12
13 // Provide the API name of the lookup field created on the LearningItem object,
14 // where the customContent record is stored.
15 global override String getLearningItemField() {
16 return 'FlowVersion__c';
17 }
18}LearningItemTypeHandler Methods
The following are methods for LearningItemTypeHandler.
getEntityId()
Returns the API name of the Salesforce object that stores the custom exercise
data.
Signature
public String getEntityId()
Return Value
Type: String
getLearningItemField()
Returns the API name of the lookup field created on the LearningItem object, whish stores
the customContent records. customContent is specified in the lightning__EnablementProgram target of an Lightning Web Component (LWC).
Signature
public String getLearningItemField()
Return Value
Type: String