Newer Version Available

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

LWC Configuration

In order to access the TPM promotion data in LWC layer, the tpm-promotion service component is used. Use the tpm-promotion component to hook into the promotion state and be able to extract data from the promotion (through events) and push new data to the promotion (through methods).
tpm-promotion component
If your org has Lightning Web Security enabled, the runtimeNamespace property on the metadata file isn’t required.

Lightning web security is a feature that must be tested before enabling. LWC Security

Note

When setting the runtimeNamespace property in the metadata file, your component cannot use modules from the ‘@salesforce’ package (any import whose route starts with @salesforce).

Troubleshooting

  • Question: When my component runs, I get the error Scoped imports are not allowed when runtime namespace is specified.

    Answer: This error appears when trying to use “@salesforce” modules in your component. When specifying a runtimeNamespace in the metadata file, your component cannot access “@salesforce” resources. To perform APEX calls and other actions that require those modules, use the tpmGenericUtils modules available functions.

  • Question: When my component runs, I get the error Attempting to reference cross-namespace module
    Error scenarios
    • Your component does not have the runtimeNamespace property set up on it metadata file. To fix it, add the runtimeNamespace property with the namespace cgcloud to your component.
    • Your component includes other custom components that do not have the runtimeNamespace property in their metadata. Add the runtimeNamespace property with the namespace cgcloud to the included components (also to the included components of the included ones). All the components used by another component with a runtimeNamespace defined must have the runtimeNamespace property in their metadata.