Features

Embed CloudFiles widget in custom lightning web components

Like all other packaged lightning web components, you can embed cloudfiles widget in your organization's custom code. This would require the steps highlighted below.

Step 1 : Enable Lightning Web Security

The goal of lightning web security is to prevent Lightning components from interfering with or accessing data that belongs to platform code or components from other namespaces. Here's a detailed article from Salesforce on this. You would need to enable this in settings in order to cross reference web components.

To use Lightning Web Security in an org:

  1. From Setup, in the Quick Find box, enter Session, and then select Session Settings.
  2. On the Session Settings page, select Use Lightning Web Security for Lightning web components and Aura components and save.



session settings page image
session settings page


Step 2 : Use the attachments widget in custom code

All CloudFiles components can be referred to with the namespace cldfs, You would use this namespace to access global classes and components from the CloudFiles managed package. To use the widget as a child component in a custom lwc, you would use it like any other child component, with the exception of replacing the first c with cldfs, signifying a custom namespace.

Apart from this, there are some mandatory inputs that the component needs in order to work properly. These would be the record-id and object-api-name

The below code block displays a simple example:

HTML