ContentAsset

Represents a Salesforce file that has been converted to an asset file in a custom app in Lightning Experience. Use asset files for org setup and configuration. Asset files can be packaged and referenced by other components. This object is available in API version 38.0 and later.

Supported Calls

create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()

Special Access Rules

  • Only admin users can edit or delete ContentAssets.
  • Users with file access can create and query ContentAssets.
  • It isn’t necessary to create asset files for regular, collaborative use of Salesforce Files. “Assetize” files only when they’re used in setup and configuration situations.
  • Neither the file (ContentDocument) nor the asset settings record (ContentAssets) can be deleted if the asset file is referenced by another component.
  • ContentAsset doesn’t support search or most recently used (MRU) lists.
  • ContentAsset doesn’t support Apex triggers.

Fields

Field Details
ContentDocumentId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
ID of the document.
DeveloperName
Type
string
Properties
Create, Filter, Group, Sort, Update
Description
The unique name of the asset file in the API. ContentAsset.DeveloperName:
  • must be 40 characters or fewer
  • must begin with a letter
  • can contain only underscores and alphanumeric characters
  • can’t include spaces
  • can’t end with an underscore
  • can’t contain 2 consecutive underscores
In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object’s name in a managed package and the changes are reflected in a subscriber’s organization.
isVisibleByExternalUsers
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
Indicates whether unauthenticated users can see the asset file.
Language
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
The language for this document. This field defaults to the user's language unless the org is multi-language enabled. Specifies the language of the labels returned. The value must be a valid user locale (language and country), such as de_DE or en_GB. For more information on locales, see the Language field on the CategoryNodeLocalization object.
MasterLabel
Type
string
Properties
Create, Filter, Group, Sort, Update
Description
The master label for the asset file. This internal label doesn’t get translated.
NamespacePrefix
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The namespace prefix associated with this object. Each Developer Edition organization that creates a managed package has a unique namespace prefix. Limit: 15 characters. You can refer to a component in a managed package by using the namespacePrefix__componentName notation.