Newer Version Available

This content describes an older version of this product. View Latest

LearningItemType Class

Represents a custom learning item type in Enablement Program Builder for an Enablement program exercise.

Namespace

sfdc_enablement

Usage

Extend the LearningItemType abstract class to create a custom learning item type. See LearningItem from Object Reference for the Salesforce Platform.

Example

This code creates a custom learning item using screen flows for an Enablement program exercise.

1global class LearningItemTypeScreenFlow extends sfdc_enablement.LearningItemType {
2    // Provide a unique API name for this custom learning item type value.
3    global override String getName() {
4        return 'ScreenFlow';
5    }
6    
7    // Provide a label for this custom learning item type.
8    global override String getLabel() {
9        return 'Screen Flow';
10    }
11    
12    // Provide the LWC that gets rendered when the user clicks the 
13    // exercise with this custom learning item in the Guidance Center.
14    global override String getComponentDef() {
15        return 'c:screenFlowHandler';
16    }
17
18    // Provide the icon for this subcategory type of the custom Enablement program 
19    // exercise to be displayed in Enablement Program Builder.
20    global override String getIcon() {
21        return 'standard:flow';
22    }
23}

LearningItemType Methods

The following are methods for LearningItemType.

getComponentDef()

Returns the Lightning Web Component (LWC) that gets rendered when the user clicks the exercise with this custom learning item in Enablement’s Guidance Center.

Signature

public String getComponentDef()

Return Value

Type: String

The format is "namespace:lwcComponentName".

getIcon()

Returns the icon shown in the Guidance Center for the Enablement program exercise with this custom learning item.

Signature

public String getIcon()

Return Value

Type: String

We support only SLDS icons from Lightning Design Systems | Icons. The format is iconType:iconName.

getLabel()

Returns a label for this custom learning item type.

Signature

public String getLabel()

Return Value

Type: String

getName()

Returns a unique API name for this custom learning item type.

Signature

public String getName()

Return Value

Type: String