DCBaseComponent

DCBaseComponent

DCBaseComponent is a base class which is extended by all lightning web components .

DCBaseComponent methods
1.Method to get digital commerce SDK instance.
2.Method to show toast
3.Debounce method
4.Method to update OmniScript data JSON

Constructor

new DCBaseComponent()

Extends

  • OmniscriptBaseMixin

Methods

(static) addNewCustomLabels(labels)

This function adds more labels to the existing labels array
Parameters:
Name Type Description
labels Array.<String> array of labels

(static) advanceOSNextStep(stepName)

Function to auto-advance the omniscript step
Parameters:
Name Type Description
stepName string optional

(static) checkProperties(obj)

This function to check whether given object has empty values or not
Parameters:
Name Type Description
obj Object

(static) customDomainUrl(url)

Method to update custom custom salesforce domain url
Parameters:
Name Type Description
url String user custom domain url

(static) debounce(wait, func, args)

This function creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked.
Parameters:
Name Type Description
wait string execution wait time in milliseconds.
func function function for which execution needs to be delayed.
args string parameters of the passed function

(static) fetchTranslatedLabels(language, labels)

This function retrieves translated labels for given language
Parameters:
Name Type Description
language String optional parameter - language
labels Array.<String> array of labels

(static) fetchURLParams()

Function to fetch the query params from the current URL.

(static) findProductGroup(hierarchyPath, productGroups)

Function to find out the matching product group for given id's path.
Parameters:
Name Type Description
hierarchyPath string
productGroups Object

(static) getDigitalCommerceSDK(namespace)

This function gets digital commerce sdk instance
Parameters:
Name Type Description
namespace string org namespace.

(static) getTranslationSDK(namespace)

This function gets translation sdk instance
Parameters:
Name Type Description
namespace string org namespace.

(static) invokeAPI(sdk, input, timeoutInMillis)

This function to check whether given object has empty values or not
Parameters:
Name Type Description
sdk Object
input Object {path:'',httpMethod:'',payload:{}}
timeoutInMillis number

(static) showToast(title, message, variant, parent)

This function is used to show toast messages
Parameters:
Name Type Description
title string toast message title.
message string toast message content.
variant string info, success, warning, error
parent string

(static) updateOmniScriptDataJson(obj)

This function updates OmniScript data JSON
Parameters:
Name Type Description
obj string JSON object to be updated in omniscript.