Loading
Enhance Salesforce with Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Add or Edit a Custom Metadata Type Declaratively

          Add or Edit a Custom Metadata Type Declaratively

          You can declaratively create and update custom metadata types.

          Required Editions

          Available in: Salesforce Classic and Lightning Experience

          Available in: Enterprise, Performance, Unlimited, and Developer Editions

          You can create, edit, and delete custom metadata type records from installed packages in: Group and Professional Editions

          User Permissions Needed
          To create or edit custom metadata types: Customize Application

          Custom metadata types and records have names and labels. Type names must be unique within their namespace. Record names must be unique within their custom metadata type and namespace.

          1. From Setup, in the Quick Find box, enter Custom Metadata Types and then select Custom Metadata Types.
          2. On the All Custom Metadata Types page, click New Custom Metadata Type, or click the Label name to modify an existing custom metadata type.
          3. Complete these fields.
            Field Description
            Label Refers to the type in a user interface page.
            Plural Label The plural name of the type. If you create a tab for this type, Plural Label is used.
            Starts with a vowel sound Indicates whether “an” precedes the label rather than “a” (only when applicable for your org’s default language).
            Object Name A unique name to refer to the object when using the API. In managed packages, this name prevents naming conflicts with package installations. Use only alphanumeric characters and underscores. The name must begin with a letter and have no spaces. It can’t end with an underscore or contain two consecutive underscores.
            Description An optional description of the object. A meaningful description helps you understand the differences between your custom objects when you view them in a list.
            Visibility

            Who can see the type.

            • (Public) Regardless of the type of package (managed or unmanaged), these have access:
              • Apex
              • Formulas
              • Flows
              • API for users with Customize Application permission or permissions granted through profiles or permission sets. The custom metadata type, fields, and unprotected records are visible in Setup.
            • (Protected) Only Apex code in the same namespace can see the type. The name of the type and the record are visible if they’re referenced in a formula.
            • (PackageProtected) When in a second-generation managed package, only Apex code in the same managed package can see the type. The name of the type and the record are visible if they’re referenced in a formula.
          4. Click Save.
          5. Under Custom Fields, click New to start adding fields to the custom metadata type. Specify the type of information that the field contains, such as a picklist or metadata relationship. For each field, choose a Field Manageability value to determine who can change the field later.
            • If FieldType is MetadataRelationship and the manageability of the entity definition field is subscriber-controlled, the Field Definition field must be subscriber-controlled.
            • If the manageability of the entity definition field is upgradeable, the Field Definition field must be either upgradeable or subscriber-controlled.
            The UI for creating custom metadata types

          Custom metadata types created before the Winter ’15 release don’t automatically get layouts. Before adding, updating, or viewing records of this custom metadata type using the UI, you must add a layout that contains all the fields that you want to make editable. In the All Custom Metadata Types page, click the custom metadata type. Then click New under Page Layouts.

           
          Loading
          Salesforce Help | Article